Skip to content

Commit

Permalink
chore: remove redundant 10.11 @avilable checks (#31184)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Sep 30, 2021
1 parent 2c10d0f commit e07d74c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 32 deletions.
6 changes: 2 additions & 4 deletions shell/browser/mac/electron_application.mm
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ - (void)invalidateCurrentActivity {
}

- (void)resignCurrentActivity {
if (@available(macOS 10.11, *)) {
if (currentActivity_)
[currentActivity_ resignCurrent];
}
if (currentActivity_)
[currentActivity_ resignCurrent];
}

- (void)updateCurrentActivity:(NSString*)type
Expand Down
33 changes: 15 additions & 18 deletions shell/browser/native_window_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1408,24 +1408,21 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
vibrancyType = NSVisualEffectMaterialTitlebar;
}

if (@available(macOS 10.11, *)) {
if (type == "selection") {
vibrancyType = NSVisualEffectMaterialSelection;
} else if (type == "menu") {
vibrancyType = NSVisualEffectMaterialMenu;
} else if (type == "popover") {
vibrancyType = NSVisualEffectMaterialPopover;
} else if (type == "sidebar") {
vibrancyType = NSVisualEffectMaterialSidebar;
} else if (type == "medium-light") {
EmitWarning(env, "NSVisualEffectMaterialMediumLight" + dep_warn,
"electron");
vibrancyType = NSVisualEffectMaterialMediumLight;
} else if (type == "ultra-dark") {
EmitWarning(env, "NSVisualEffectMaterialUltraDark" + dep_warn,
"electron");
vibrancyType = NSVisualEffectMaterialUltraDark;
}
if (type == "selection") {
vibrancyType = NSVisualEffectMaterialSelection;
} else if (type == "menu") {
vibrancyType = NSVisualEffectMaterialMenu;
} else if (type == "popover") {
vibrancyType = NSVisualEffectMaterialPopover;
} else if (type == "sidebar") {
vibrancyType = NSVisualEffectMaterialSidebar;
} else if (type == "medium-light") {
EmitWarning(env, "NSVisualEffectMaterialMediumLight" + dep_warn,
"electron");
vibrancyType = NSVisualEffectMaterialMediumLight;
} else if (type == "ultra-dark") {
EmitWarning(env, "NSVisualEffectMaterialUltraDark" + dep_warn, "electron");
vibrancyType = NSVisualEffectMaterialUltraDark;
}

if (@available(macOS 10.14, *)) {
Expand Down
17 changes: 7 additions & 10 deletions shell/browser/ui/tray_icon_cocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,13 @@ - (void)setTitle:(NSString*)title font_type:(NSString*)font_type {
range:NSMakeRange(0, [attributed_title length])];
}
} else if ([font_type isEqualToString:@"monospacedDigit"]) {
if (@available(macOS 10.11, *)) {
NSDictionary* attributes = @{
NSFontAttributeName :
[NSFont monospacedDigitSystemFontOfSize:existing_size
weight:NSFontWeightRegular]
};
[attributed_title
addAttributes:attributes
range:NSMakeRange(0, [attributed_title length])];
}
NSDictionary* attributes = @{
NSFontAttributeName :
[NSFont monospacedDigitSystemFontOfSize:existing_size
weight:NSFontWeightRegular]
};
[attributed_title addAttributes:attributes
range:NSMakeRange(0, [attributed_title length])];
}

// Set title
Expand Down

0 comments on commit e07d74c

Please sign in to comment.