Skip to content

Commit

Permalink
Revert "perf(UI): change quick setting button tint color to light blue"
Browse files Browse the repository at this point in the history
This reverts commit e5d9dc4.
  • Loading branch information
NeverAgain11 committed Mar 2, 2024
1 parent c9d60ce commit 196b74b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Easydict/Feature/ViewController/View/Titlebar/EZTitlebar.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,27 @@ - (void)setup {
[self setupSettingButton];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateConstraints) name:EZQuickLinkButtonUpdateNotification object:nil];

}

- (void)setupSettingButton {
EZOpenLinkButton *button = [[EZOpenLinkButton alloc] init];
NSImage *image = [[NSImage imageWithSystemSymbolName:@"switch.2" accessibilityDescription:nil] imageWithSymbolConfiguration:[NSImageSymbolConfiguration configurationWithScale:NSImageSymbolScaleLarge]];
button.image = [[image imageWithTintColor:[NSColor ez_imageTintBlueColor]] resizeToSize:CGSizeMake(20, 20)];
NSImage *image = [[NSImage imageWithSystemSymbolName:@"switch.2" accessibilityDescription:nil]imageWithSymbolConfiguration:[NSImageSymbolConfiguration configurationWithScale:NSImageSymbolScaleLarge]];

button.image = image;
self.settingButton = button;
button.clickBlock = nil;

NSColor *lightTintColor = [NSColor mm_colorWithHexString:@"#797A7F"];
NSColor *darkTintColor = [NSColor mm_colorWithHexString:@"#C0C1C4"];
CGSize imageSize = CGSizeMake(20, 20);

[button excuteLight:^(EZButton *button) {
button.image = [[image imageWithTintColor:lightTintColor] resizeToSize:imageSize];
} dark:^(EZButton *button) {
button.image = [[image imageWithTintColor:darkTintColor] resizeToSize:imageSize];
}];

[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(24);
}];
Expand All @@ -87,6 +99,7 @@ - (void)setupSettingButton {
[button setMouseUpBlock:^(EZButton *_Nonnull button) {
mm_strongify(self);
[self showMenu];

}];
}

Expand Down

0 comments on commit 196b74b

Please sign in to comment.