Prevent the "Mute" menu item from being incorrectly displayed as marked while paused

This commit is contained in:
Lior Halphon
2024-08-25 18:03:01 +03:00
parent c7c54abb6b
commit 430e42fa72

View File

@@ -1250,7 +1250,12 @@ static bool is_path_writeable(const char *path)
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)anItem - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)anItem
{ {
if ([anItem action] == @selector(mute:)) { if ([anItem action] == @selector(mute:)) {
[(NSMenuItem *)anItem setState:!_audioClient.isPlaying]; if (_running) {
[(NSMenuItem *)anItem setState:!_audioClient.isPlaying];
}
else {
[(NSMenuItem *)anItem setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"Mute"]];
}
} }
else if ([anItem action] == @selector(togglePause:)) { else if ([anItem action] == @selector(togglePause:)) {
[(NSMenuItem *)anItem setState:self.isPaused]; [(NSMenuItem *)anItem setState:self.isPaused];