fix: macOS 15 ignores alternate item, remove isMainMenu
This commit is contained in:
@@ -6,7 +6,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@interface NSMenu (Ext)
|
@interface NSMenu (Ext)
|
||||||
@property (nonnull, copy, readonly) NSString *titleIndexPath;
|
@property (nonnull, copy, readonly) NSString *titleIndexPath;
|
||||||
@property (nullable, readonly) NSMenuItem* parentItem;
|
@property (nullable, readonly) NSMenuItem* parentItem;
|
||||||
@property (readonly) BOOL isMainMenu;
|
|
||||||
@property (readonly) BOOL isFeedMenu;
|
@property (readonly) BOOL isFeedMenu;
|
||||||
|
|
||||||
// Generator
|
// Generator
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ typedef NS_ENUM(NSInteger, MenuItemTag) {
|
|||||||
return [self.supermenu itemAtIndex:[self.supermenu indexOfItemWithSubmenu:self]];
|
return [self.supermenu itemAtIndex:[self.supermenu indexOfItemWithSubmenu:self]];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return @c YES if menu is status bar menu.
|
|
||||||
- (BOOL)isMainMenu { return (self.supermenu == nil); }
|
|
||||||
|
|
||||||
/// @return @c YES if menu contains feed articles only.
|
/// @return @c YES if menu contains feed articles only.
|
||||||
- (BOOL)isFeedMenu { return ([self.title characterAtIndex:0] == 'F'); }
|
- (BOOL)isFeedMenu { return ([self.title characterAtIndex:0] == 'F'); }
|
||||||
|
|
||||||
@@ -138,7 +135,7 @@ typedef NS_ENUM(NSInteger, MenuItemTag) {
|
|||||||
static NSString* const mr[] = {Pref_globalMarkRead, Pref_groupMarkRead, Pref_feedMarkRead};
|
static NSString* const mr[] = {Pref_globalMarkRead, Pref_groupMarkRead, Pref_feedMarkRead};
|
||||||
static NSString* const mu[] = {Pref_globalMarkUnread, Pref_groupMarkUnread, Pref_feedMarkUnread};
|
static NSString* const mu[] = {Pref_globalMarkUnread, Pref_groupMarkUnread, Pref_feedMarkUnread};
|
||||||
static NSString* const ou[] = {Pref_globalOpenUnread, Pref_groupOpenUnread, Pref_feedOpenUnread};
|
static NSString* const ou[] = {Pref_globalOpenUnread, Pref_groupOpenUnread, Pref_feedOpenUnread};
|
||||||
int i = (self.isMainMenu ? 0 : (self.isFeedMenu ? 2 : 1));
|
int i = (self.supermenu == nil ? 0 : (self.isFeedMenu ? 2 : 1));
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case TagMarkAllRead: return UserPrefsBool(mr[i]);
|
case TagMarkAllRead: return UserPrefsBool(mr[i]);
|
||||||
case TagMarkAllUnread: return UserPrefsBool(mu[i]);
|
case TagMarkAllUnread: return UserPrefsBool(mu[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user