2014-08-27 17:04:39 +00:00
|
|
|
/* HBHUDButtonCell.m $
|
|
|
|
|
|
|
|
This file is part of the HandBrake source code.
|
|
|
|
Homepage: <http://handbrake.fr/>.
|
|
|
|
It may be used under the terms of the GNU General Public License. */
|
2014-08-22 17:59:21 +00:00
|
|
|
|
|
|
|
#import "HBHUDView.h"
|
|
|
|
|
2018-06-08 16:59:25 +02:00
|
|
|
@implementation HBHUDView
|
2014-08-22 17:59:21 +00:00
|
|
|
|
2016-05-03 18:47:14 +02:00
|
|
|
- (instancetype)initWithFrame:(NSRect)frame
|
2014-08-22 17:59:21 +00:00
|
|
|
{
|
2016-05-03 18:47:14 +02:00
|
|
|
self = [super initWithFrame:frame];
|
2014-08-22 17:59:21 +00:00
|
|
|
|
2016-05-03 18:47:14 +02:00
|
|
|
if (self)
|
|
|
|
{
|
|
|
|
self.wantsLayer = YES;
|
2020-11-05 13:11:51 +01:00
|
|
|
|
|
|
|
CGFloat radius = 4;
|
2021-10-15 18:41:40 +02:00
|
|
|
if (@available (macOS 11, *))
|
|
|
|
{
|
|
|
|
radius = 10;
|
|
|
|
}
|
2020-11-05 13:11:51 +01:00
|
|
|
self.layer.cornerRadius = radius;
|
2016-05-03 18:47:14 +02:00
|
|
|
|
|
|
|
self.blendingMode = NSVisualEffectBlendingModeWithinWindow;
|
|
|
|
self.material = NSVisualEffectMaterialDark;
|
|
|
|
self.state = NSVisualEffectStateActive;
|
2014-08-22 17:59:21 +00:00
|
|
|
|
2016-05-03 18:47:14 +02:00
|
|
|
self.appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark];
|
|
|
|
}
|
|
|
|
return self;
|
2014-08-22 17:59:21 +00:00
|
|
|
}
|
|
|
|
|
2016-05-03 18:47:14 +02:00
|
|
|
- (BOOL)acceptsFirstResponder
|
2014-08-22 17:59:21 +00:00
|
|
|
{
|
2016-05-03 18:47:14 +02:00
|
|
|
return YES;
|
|
|
|
}
|
2014-08-24 05:54:31 +00:00
|
|
|
|
2016-05-03 18:47:14 +02:00
|
|
|
@end
|