4747
4848#define kMaxProgressRefreshRate 10.0 // Hz
4949
50- #define kNavigateMinWidth 174.0
5150#define kNavigateSegmentWidth 34.0
52- #define kTitleMaxWidth HUGE_VALF
5351#define kSearchFieldCompactWidth 180.0
5452#define kSearchFieldExpandedWidth 238.0
5553
@@ -64,7 +62,7 @@ @interface Document () <NSToolbarDelegate, NSTextFieldDelegate, GCLiveRepository
6462@property (nonatomic ) IBOutlet GICustomToolbarItem* navigateItem;
6563@property (nonatomic ) IBOutlet GICustomToolbarItem* titleItem;
6664@property (nonatomic ) IBOutlet NSToolbarItem * snapshotsItem;
67- @property (nonatomic ) IBOutlet NSToolbarItem <GISearchToolbarItem> * searchItem;
65+ @property (nonatomic ) IBOutlet NSSearchToolbarItem * searchItem;
6866@end
6967
7068static NSDictionary * _helpPlist = nil ;
@@ -300,18 +298,7 @@ - (void)windowControllerDidLoadNib:(NSWindowController*)windowController {
300298
301299 NSSegmentedControl * modeControl = (NSSegmentedControl *)_navigateItem.primaryControl ;
302300 NSSegmentedControl * navigateControl = (NSSegmentedControl *)_navigateItem.secondaryControl ;
303- if (@available (macOS 11 , *)) {
304- // Fully custom symbols not available before 11.0.
305- [modeControl setImage: [NSImage imageNamed: @" circle.2.line.diagonal" ] forSegment: kWindowModeID_Map ];
306- } else {
307- _mainWindow.titleVisibility = NSWindowTitleHidden;
308- [modeControl setWidth: kNavigateSegmentWidth forSegment: kWindowModeID_Map ];
309- [modeControl setWidth: kNavigateSegmentWidth forSegment: kWindowModeID_Commit ];
310- [modeControl setWidth: kNavigateSegmentWidth forSegment: kWindowModeID_Stashes ];
311- [navigateControl setWidth: kNavigateSegmentWidth forSegment: kNavigationAction_Exit ];
312- [navigateControl setWidth: kNavigateSegmentWidth forSegment: kNavigationAction_Next ];
313- [navigateControl setWidth: kNavigateSegmentWidth forSegment: kNavigationAction_Previous ];
314- }
301+ [modeControl setImage: [NSImage imageNamed: @" circle.2.line.diagonal" ] forSegment: kWindowModeID_Map ];
315302
316303 NSLayoutConstraint * searchFieldPreferredWidth = [_searchItem.searchField.widthAnchor constraintEqualToConstant: kSearchFieldCompactWidth ];
317304 searchFieldPreferredWidth.priority = NSLayoutPriorityDefaultHigh - 20 ;
@@ -619,9 +606,7 @@ - (void)_updateTitleBar {
619606 NSString * countText = [NSString stringWithFormat: NSLocalizedString(@" %@ " , nil ), _FormatCommitCount (_numberFormatter, totalCount)];
620607 _titleItem.primaryControl .stringValue = _windowController.window .title ;
621608 _titleItem.secondaryControl .stringValue = countText;
622- if (@available (macOS 11.0 , *)) {
623- _windowController.window .subtitle = countText;
624- }
609+ _windowController.window .subtitle = countText;
625610}
626611
627612static NSString * _StringFromRepositoryState (GCRepositoryState state) {
@@ -1146,11 +1131,7 @@ - (void)restoreStateWithCoder:(NSCoder*)coder {
11461131#pragma mark - NSToolbarDelegate
11471132
11481133- (NSArray *)toolbarDefaultItemIdentifiers : (NSToolbar *)toolbar {
1149- if (@available (macOS 11 , *)) {
1150- return @[ _navigateItem.itemIdentifier, NSToolbarFlexibleSpaceItemIdentifier , _snapshotsItem.itemIdentifier, _searchItem.itemIdentifier ];
1151- } else {
1152- return @[ _navigateItem.itemIdentifier, NSToolbarSpaceItemIdentifier , _titleItem.itemIdentifier, NSToolbarFlexibleSpaceItemIdentifier , _snapshotsItem.itemIdentifier, _searchItem.itemIdentifier ];
1153- }
1134+ return @[ _navigateItem.itemIdentifier, NSToolbarFlexibleSpaceItemIdentifier , _snapshotsItem.itemIdentifier, _searchItem.itemIdentifier ];
11541135}
11551136
11561137#pragma mark - NSTextFieldDelegate
@@ -1662,9 +1643,7 @@ - (IBAction)resetHard:(id)sender {
16621643 alert.informativeText = NSLocalizedString(@" Any operation in progress (merge, rebase, etc...) will be aborted, and any uncommitted change, including in submodules, will be discarded.\n\n This action cannot be undone." , nil );
16631644 alert.accessoryView = _resetView;
16641645 NSButton * reset = [alert addButtonWithTitle: NSLocalizedString(@" Reset" , nil )];
1665- if (@available (macOS 11 , *)) {
1666- reset.hasDestructiveAction = YES ;
1667- }
1646+ reset.hasDestructiveAction = YES ;
16681647 [alert addButtonWithTitle: NSLocalizedString(@" Cancel" , nil )];
16691648 [alert beginSheetModalForWindow: _mainWindow
16701649 completionHandler: ^(NSInteger returnCode) {
0 commit comments