Skip to content

Commit 83e4c19

Browse files
committed
Bump minimum to macOS 11.5
1 parent a4e7ebd commit 83e4c19

File tree

14 files changed

+48
-119
lines changed

14 files changed

+48
-119
lines changed

GitUp/Application/Base.lproj/Document.xib

Lines changed: 24 additions & 25 deletions
Large diffs are not rendered by default.

GitUp/Application/Document.m

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
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

7068
static 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

627612
static 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\nThis 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) {

GitUp/GitUp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@
659659
"$(inherited)",
660660
"@executable_path/../Frameworks",
661661
);
662-
MACOSX_DEPLOYMENT_TARGET = 10.15;
662+
MACOSX_DEPLOYMENT_TARGET = 11.5;
663663
MARKETING_VERSION = 1.4.3;
664664
PRODUCT_BUNDLE_IDENTIFIER = "co.gitup.mac-debug";
665665
PRODUCT_NAME = GitUp;
@@ -679,7 +679,7 @@
679679
"$(inherited)",
680680
"@executable_path/../Frameworks",
681681
);
682-
MACOSX_DEPLOYMENT_TARGET = 10.15;
682+
MACOSX_DEPLOYMENT_TARGET = 11.5;
683683
MARKETING_VERSION = 1.4.3;
684684
PRODUCT_BUNDLE_IDENTIFIER = co.gitup.mac;
685685
PRODUCT_NAME = GitUp;

GitUpKit/Components/GIDiffFilesViewController.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ @interface GIDiffFilesViewController () <NSFilePromiseProviderDelegate>
3939
@end
4040

4141
/// Allows augmenting a file promise with custom intra-app data.
42-
API_AVAILABLE(macos(10.12))
4342
@interface GIDiffFileProvider : NSFilePromiseProvider
4443
@property(strong) id<NSPasteboardWriting> overridePasteboardWriter;
4544
@end
@@ -339,7 +338,7 @@ - (NSString*)_SHA1ForDelta:(GCDiffDelta*)delta {
339338
}
340339
}
341340

342-
- (NSString*)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider fileNameForType:(NSString*)fileType API_AVAILABLE(macos(10.12)) {
341+
- (NSString*)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider fileNameForType:(NSString*)fileType {
343342
GCDiffDelta* delta = filePromiseProvider.userInfo;
344343
NSString* SHA1 = [[self _SHA1ForDelta:delta] substringToIndex:7];
345344
NSString* basename = delta.canonicalPath.stringByDeletingPathExtension.lastPathComponent;
@@ -348,7 +347,7 @@ - (NSString*)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider fil
348347
return filename;
349348
}
350349

351-
- (void)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider writePromiseToURL:(NSURL*)url completionHandler:(void (^)(NSError* errorOrNil))completionHandler API_AVAILABLE(macos(10.12)) {
350+
- (void)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider writePromiseToURL:(NSURL*)url completionHandler:(void (^)(NSError* errorOrNil))completionHandler {
352351
GCDiffDelta* delta = filePromiseProvider.userInfo;
353352
NSString* SHA1 = [self _SHA1ForDelta:delta];
354353
NSError* error;

GitUpKit/Core/GCRepository.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ typedef NS_ENUM(NSUInteger, GCFileMode) {
6868

6969
- (BOOL)checkPathNotIgnored:(NSString*)path error:(NSError**)error;
7070

71+
- (NSURL*)absoluteURLForFile:(NSString*)path;
7172
- (NSString*)absolutePathForFile:(NSString*)path;
7273

7374
- (BOOL)safeDeleteFile:(NSString*)path error:(NSError**)error; // Moves file to Trash (OS X only)

GitUpKit/Core/GCRepository.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ - (BOOL)checkPathNotIgnored:(NSString*)path error:(NSError**)error {
263263
return YES;
264264
}
265265

266+
- (NSURL*)absoluteURLForFile:(NSString*)path {
267+
NSString* absolutePath = [self absolutePathForFile:path];
268+
return [NSURL fileURLWithPath:absolutePath];
269+
}
270+
266271
- (NSString*)absolutePathForFile:(NSString*)path {
267272
XLOG_CHECK(_workingDirectoryPath && path.length);
268273
return [_workingDirectoryPath stringByAppendingPathComponent:path];

GitUpKit/GitUpKit.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@
16321632
"$(inherited)",
16331633
"$(SDKROOT)/usr/lib/system",
16341634
);
1635-
MACOSX_DEPLOYMENT_TARGET = 10.15;
1635+
MACOSX_DEPLOYMENT_TARGET = 11.5;
16361636
PRODUCT_BUNDLE_IDENTIFIER = co.gitup.kit;
16371637
PRODUCT_NAME = GitUpKit;
16381638
SDKROOT = macosx;
@@ -1657,7 +1657,7 @@
16571657
"$(inherited)",
16581658
"$(SDKROOT)/usr/lib/system",
16591659
);
1660-
MACOSX_DEPLOYMENT_TARGET = 10.15;
1660+
MACOSX_DEPLOYMENT_TARGET = 11.5;
16611661
PRODUCT_BUNDLE_IDENTIFIER = co.gitup.kit;
16621662
PRODUCT_NAME = GitUpKit;
16631663
SDKROOT = macosx;

GitUpKit/Interface/GIGraphView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,9 +1375,9 @@ static void _DrawSelectedNode(CGContextRef context, CGFloat x, CGFloat y, GINode
13751375
// Draw label
13761376

13771377
if (isFirstResponder) {
1378-
CGContextSetFillColorWithColor(context, [[NSColor alternateSelectedControlColor] CGColor]); // NSTableView focused highlight color
1378+
CGContextSetFillColorWithColor(context, NSColor.selectedContentBackgroundColor.CGColor); // NSTableView focused highlight color
13791379
} else {
1380-
CGContextSetFillColorWithColor(context, [[NSColor secondarySelectedControlColor] CGColor]); // NSTableView unfocused highlight color
1380+
CGContextSetFillColorWithColor(context, NSColor.unemphasizedSelectedContentBackgroundColor.CGColor); // NSTableView unfocused highlight color
13811381
}
13821382
CGContextAddPath(context, labelPath);
13831383
CGContextFillPath(context);

GitUpKit/Interface/GISplitDiffView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ - (void)drawRect:(NSRect)dirtyRect {
357357
if (_lines.count) {
358358
drawHorizontalSeparator(0.5);
359359

360-
NSColor* selectedColor = self.window.keyWindow && (self.window.firstResponder == self) ? [NSColor selectedControlColor] : [NSColor secondarySelectedControlColor];
360+
NSColor* selectedColor = self.window.keyWindow && (self.window.firstResponder == self) ? NSColor.selectedControlColor : NSColor.unemphasizedSelectedContentBackgroundColor;
361361
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
362362
NSUInteger count = _lines.count;
363363
NSUInteger start = MIN(MAX(count - (dirtyRect.origin.y + dirtyRect.size.height - kTextBottomPadding) / self.lineHeight, 0), count);

GitUpKit/Interface/GIUnifiedDiffView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ - (void)drawRect:(NSRect)dirtyRect {
277277
if (_frame) {
278278
drawHorizontalSeparator(0.5);
279279

280-
NSColor* selectedColor = self.window.keyWindow && (self.window.firstResponder == self) ? [NSColor selectedControlColor] : [NSColor secondarySelectedControlColor];
280+
NSColor* selectedColor = self.window.keyWindow && (self.window.firstResponder == self) ? NSColor.selectedControlColor : NSColor.unemphasizedSelectedContentBackgroundColor;
281281
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
282282
CFArrayRef lines = CTFrameGetLines(_frame);
283283
CFIndex count = CFArrayGetCount(lines);

0 commit comments

Comments
 (0)