Skip to content

Commit

Permalink
Deprecation warnings in macOS 10.14
Browse files Browse the repository at this point in the history
  • Loading branch information
relikd committed Oct 3, 2019
1 parent 37fc109 commit 58d7660
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion baRSS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>14360</string>
<string>14394</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.news</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion baRSS/NSCategories/NSView+Ext.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ + (NSProgressIndicator*)activitySpinner {
NSProgressIndicator *spin = [[NSProgressIndicator alloc] initWithFrame: NSMakeRect(0, 0, HEIGHT_SPINNER, HEIGHT_SPINNER)];
spin.indeterminate = YES;
spin.displayedWhenStopped = NO;
spin.style = NSProgressIndicatorSpinningStyle;
spin.style = NSProgressIndicatorStyleSpinning;
spin.controlSize = NSControlSizeSmall;
return spin;
}
Expand Down
13 changes: 7 additions & 6 deletions baRSS/Status Bar Menu/BarStatusItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ - (instancetype)init {
self = [super init];
// Show icon & prefetch unread count
self.statusItem = [NSStatusBar.systemStatusBar statusItemWithLength:NSVariableStatusItemLength];
self.statusItem.highlightMode = YES;
self.unreadCountTotal = 0;
self.statusItem.image = [NSImage imageNamed:RSSImageMenuBarIconActive];
self.statusItem.image.template = YES;
self.statusItem.button.image = [NSImage imageNamed:RSSImageMenuBarIconActive];
self.statusItem.button.image.template = YES;
// Add empty menu (will be populated once opened)
self.statusItem.menu = [[NSMenu alloc] initWithTitle:@"M"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mainMenuWillOpen) name:NSMenuDidBeginTrackingNotification object:self.statusItem.menu];
Expand Down Expand Up @@ -119,11 +118,13 @@ - (void)updateBarIcon {
dispatch_async(dispatch_get_main_queue(), ^{
BOOL hasNet = [UpdateScheduler allowNetworkConnection];
BOOL tint = (self.unreadCountTotal > 0 && hasNet && UserPrefsBool(Pref_globalTintMenuIcon));
self.statusItem.image = [NSImage imageNamed:(hasNet ? RSSImageMenuBarIconActive : RSSImageMenuBarIconPaused)];
self.statusItem.image.template = !tint;
self.statusItem.button.image = [NSImage imageNamed:(hasNet ? RSSImageMenuBarIconActive : RSSImageMenuBarIconPaused)];
self.statusItem.button.image.template = !tint;
// TODO: use macOS 10.14 contentTintColor, if (@available(macOS 10.14, *)) {} else {}

BOOL showCount = (self.unreadCountTotal > 0 && UserPrefsBool(Pref_globalUnreadCount));
self.statusItem.title = (showCount ? [NSString stringWithFormat:@"%ld", self.unreadCountTotal] : @"");
self.statusItem.button.title = (showCount ? [NSString stringWithFormat:@"%ld", self.unreadCountTotal] : @"");
self.statusItem.button.imagePosition = (showCount ? NSImageLeft : NSImageOnly);
});
}

Expand Down

0 comments on commit 58d7660

Please sign in to comment.