Skip to content

Commit

Permalink
Merge pull request #1 from oliveratgithub/master
Browse files Browse the repository at this point in the history
Contributions for 2ndalpha#220
  • Loading branch information
sweetppro authored Mar 27, 2023
2 parents f5e4d19 + cee8fc3 commit 61dcc29
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle.git",
"state" : {
"revision" : "7918c1c8fc68baa37917eeaa67286b077ad5e393",
"version" : "1.27.1"
"revision" : "dda155c7d3ef38c53d29f8584cb2aad2a1a54dba",
"version" : "2.3.2"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.8.6</string>
<string>0.8.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -59,7 +59,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>0.8.6</string>
<string>0.8.7</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSUIElement</key>
Expand Down
2 changes: 1 addition & 1 deletion Source/FileUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ @implementation FileUtil
+ (NSString*)dataDirectory
{
if (dataDirectory == nil) {
NSArray *array = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
dataDirectory = [[array objectAtIndex:0] stringByAppendingString:@"/Gas Mask/"];
}
return dataDirectory;
Expand Down
10 changes: 5 additions & 5 deletions Source/HostsListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ @implementation HostsListView

- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSPasteboardTypeString, NSFilenamesPboardType, nil]];
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSPasteboardTypeString, NSPasteboardTypeFileURL, nil]];
[self setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES];
[self setDraggingSourceOperationMask:NSDragOperationEvery forLocal:NO];

[self setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList];
[self setStyle:NSTableViewStyleSourceList];

NSTableColumn *tableColumn = [self tableColumnWithIdentifier:kColumnIdName];
cell = [[Cell alloc] init];
[cell setEditable:YES];
Expand Down Expand Up @@ -98,15 +98,15 @@ - (void)removeBadgesFromGroups
#pragma mark -
#pragma mark NSDraggingSource

- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation
- (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation
{
// Dragged item ended up in Trash
if (operation == NSDragOperationDelete) {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc postNotificationName:DraggedFileShouldBeRemovedNotification object:nil];
}
else {
[super draggedImage:image endedAt:screenPoint operation:operation];
[super draggingSession:session endedAtPoint:screenPoint operation:operation];
}
}

Expand Down
3 changes: 3 additions & 0 deletions Source/LocalHostsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ - (void)loadFiles
}

[hostsFiles addObject:hosts];
// grossly sorting array every time we add a host? Probably there is a better way.
NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
[hostsFiles sortUsingDescriptors:[NSArray arrayWithObject:sort]];
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions Source/Util.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ + (BOOL) restartDNSResponder

+ (BOOL) isDarkMode
{
NSAppearance *appearance = NSAppearance.currentAppearance;
return appearance.name == NSAppearanceNameDarkAqua;
NSAppearance *currentAppearance = NSAppearance.currentDrawingAppearance;
if (@available(macOS 10.14, *)) {
return currentAppearance.name == NSAppearanceNameDarkAqua;
} else {
return [[NSColor controlTextColor] isEqual:[NSColor whiteColor]];
}
}

@end

0 comments on commit 61dcc29

Please sign in to comment.