MacGui: fix the dock tiles showing up when switching to dark mode and back even when there is no encode running.

This commit is contained in:
Damiano Galassi 2024-02-29 20:07:04 +01:00
parent 3200f3fe0f
commit d21eda8cfb
No known key found for this signature in database
GPG Key ID: 5452E231DFDBCA11
2 changed files with 6 additions and 3 deletions

View File

@ -23,7 +23,8 @@
- (instancetype)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self) {
if (self)
{
[[self cell] setBezelStyle:NSBezelStyleRounded];
_textAttributes = [self textAttributesWithFontSize:DOCK_TEXTFIELD_FONTSIZE];
_smallTextAttributes = [self textAttributesWithFontSize:DOCK_TEXTFIELD_FONTSIZE - 2];

View File

@ -11,8 +11,8 @@
@property (nonatomic, strong) NSDockTile *dockTile;
@property (nonatomic, strong) NSImage *image;
@property (nonatomic, strong) HBDockTextField * percentField;
@property (nonatomic, strong) HBDockTextField * timeField;
@property (nonatomic, strong) HBDockTextField *percentField;
@property (nonatomic, strong) HBDockTextField *timeField;
@end
@ -36,10 +36,12 @@
dockTile.contentView = iv;
_percentField = [[HBDockTextField alloc] initWithFrame:NSMakeRect(0.0f, 32.0f, dockTile.size.width, 30.0f)];
_percentField.hidden = YES;
[_percentField changeGradientColors:[NSColor colorWithDeviceRed:0.4f green:0.6f blue:0.4f alpha:1.0f] endColor:[NSColor colorWithDeviceRed:0.2f green:0.4f blue:0.2f alpha:1.0f]];
[iv addSubview:_percentField];
_timeField = [[HBDockTextField alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, dockTile.size.width, 30.0f)];
_timeField.hidden = YES;
[_timeField changeGradientColors:[NSColor colorWithDeviceRed:0.6f green:0.4f blue:0.4f alpha:1.0f] endColor:[NSColor colorWithDeviceRed:0.4f green:0.2f blue:0.2f alpha:1.0f]];
[iv addSubview:_timeField];
}