chore: remove redundant 10.11 @avilable checks (#31184)
This commit is contained in:
parent
2c10d0fe1b
commit
e07d74cf29
3 changed files with 24 additions and 32 deletions
|
@ -99,10 +99,8 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)resignCurrentActivity {
|
- (void)resignCurrentActivity {
|
||||||
if (@available(macOS 10.11, *)) {
|
|
||||||
if (currentActivity_)
|
if (currentActivity_)
|
||||||
[currentActivity_ resignCurrent];
|
[currentActivity_ resignCurrent];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateCurrentActivity:(NSString*)type
|
- (void)updateCurrentActivity:(NSString*)type
|
||||||
|
|
|
@ -1408,7 +1408,6 @@ void NativeWindowMac::SetVibrancy(const std::string& type) {
|
||||||
vibrancyType = NSVisualEffectMaterialTitlebar;
|
vibrancyType = NSVisualEffectMaterialTitlebar;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@available(macOS 10.11, *)) {
|
|
||||||
if (type == "selection") {
|
if (type == "selection") {
|
||||||
vibrancyType = NSVisualEffectMaterialSelection;
|
vibrancyType = NSVisualEffectMaterialSelection;
|
||||||
} else if (type == "menu") {
|
} else if (type == "menu") {
|
||||||
|
@ -1422,11 +1421,9 @@ void NativeWindowMac::SetVibrancy(const std::string& type) {
|
||||||
"electron");
|
"electron");
|
||||||
vibrancyType = NSVisualEffectMaterialMediumLight;
|
vibrancyType = NSVisualEffectMaterialMediumLight;
|
||||||
} else if (type == "ultra-dark") {
|
} else if (type == "ultra-dark") {
|
||||||
EmitWarning(env, "NSVisualEffectMaterialUltraDark" + dep_warn,
|
EmitWarning(env, "NSVisualEffectMaterialUltraDark" + dep_warn, "electron");
|
||||||
"electron");
|
|
||||||
vibrancyType = NSVisualEffectMaterialUltraDark;
|
vibrancyType = NSVisualEffectMaterialUltraDark;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (@available(macOS 10.14, *)) {
|
if (@available(macOS 10.14, *)) {
|
||||||
if (type == "header") {
|
if (type == "header") {
|
||||||
|
|
|
@ -125,17 +125,14 @@
|
||||||
range:NSMakeRange(0, [attributed_title length])];
|
range:NSMakeRange(0, [attributed_title length])];
|
||||||
}
|
}
|
||||||
} else if ([font_type isEqualToString:@"monospacedDigit"]) {
|
} else if ([font_type isEqualToString:@"monospacedDigit"]) {
|
||||||
if (@available(macOS 10.11, *)) {
|
|
||||||
NSDictionary* attributes = @{
|
NSDictionary* attributes = @{
|
||||||
NSFontAttributeName :
|
NSFontAttributeName :
|
||||||
[NSFont monospacedDigitSystemFontOfSize:existing_size
|
[NSFont monospacedDigitSystemFontOfSize:existing_size
|
||||||
weight:NSFontWeightRegular]
|
weight:NSFontWeightRegular]
|
||||||
};
|
};
|
||||||
[attributed_title
|
[attributed_title addAttributes:attributes
|
||||||
addAttributes:attributes
|
|
||||||
range:NSMakeRange(0, [attributed_title length])];
|
range:NSMakeRange(0, [attributed_title length])];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Set title
|
// Set title
|
||||||
[[statusItem_ button] setAttributedTitle:attributed_title];
|
[[statusItem_ button] setAttributedTitle:attributed_title];
|
||||||
|
|
Loading…
Reference in a new issue