Skip to content

Commit

Permalink
Remove deprecated min/max toolbar item size
Browse files Browse the repository at this point in the history
  • Loading branch information
livings124 committed Nov 18, 2020
1 parent 31413df commit 0916844
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions macosx/Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -3634,9 +3634,13 @@ - (id) toolbarButtonWithIdentifier: (NSString *) ident forToolbarButtonClass:(Cl

[item setView: button];

const NSSize buttonSize = NSMakeSize(36.0, 25.0);
[item setMinSize: buttonSize];
[item setMaxSize: buttonSize];
if (@available(macOS 11.0, *)) {
// not needed
} else {
const NSSize buttonSize = NSMakeSize(36.0, 25.0);
[item setMinSize: buttonSize];
[item setMaxSize: buttonSize];
}

return item;
}
Expand Down Expand Up @@ -3729,9 +3733,13 @@ - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSStr
[segmentedControl setSegmentCount: 2];
[segmentedCell setTrackingMode: NSSegmentSwitchTrackingMomentary];

const NSSize groupSize = NSMakeSize(72.0, 25.0);
[groupItem setMinSize: groupSize];
[groupItem setMaxSize: groupSize];
if (@available(macOS 11.0, *)) {
// not needed
} else {
const NSSize groupSize = NSMakeSize(72.0, 25.0);
[groupItem setMinSize: groupSize];
[groupItem setMaxSize: groupSize];
}

[groupItem setLabel: NSLocalizedString(@"Apply All", "All toolbar item -> label")];
[groupItem setPaletteLabel: NSLocalizedString(@"Pause / Resume All", "All toolbar item -> palette label")];
Expand Down Expand Up @@ -3774,9 +3782,13 @@ - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSStr
[segmentedControl setSegmentCount: 2];
[segmentedCell setTrackingMode: NSSegmentSwitchTrackingMomentary];

const NSSize groupSize = NSMakeSize(72.0, 25.0);
[groupItem setMinSize: groupSize];
[groupItem setMaxSize: groupSize];
if (@available(macOS 11.0, *)) {
// not needed
} else {
const NSSize groupSize = NSMakeSize(72.0, 25.0);
[groupItem setMinSize: groupSize];
[groupItem setMaxSize: groupSize];
}

[groupItem setLabel: NSLocalizedString(@"Apply Selected", "Selected toolbar item -> label")];
[groupItem setPaletteLabel: NSLocalizedString(@"Pause / Resume Selected", "Selected toolbar item -> palette label")];
Expand Down

0 comments on commit 0916844

Please sign in to comment.