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