* Source/NSApplication.m (hide:): change title of "Hide" menu item

to "Unhide". Call `-unhide:` if application is in hidden state.
  With this change it's possible to unhide application with
  right-click on application icon followed by "Unhide" menu item
  selection (item action remains NSFirstResponder's `-hide:').
  (unhide:): change title of "Unhide" menu item to "Hide".
This commit is contained in:
Sergii Stoian 2020-10-13 16:09:59 +03:00
parent 387d416c0a
commit 2c6482ff9c

View file

@ -2555,6 +2555,8 @@ image.</p><p>See Also: -applicationIconImage</p>
{
[[_app_icon_window contentView] setNeedsDisplay: YES];
}
[[_main_menu itemWithTitle:@"Hide"] setTitle:@"Unhide"];
_unhide_on_activation = YES;
@ -2575,6 +2577,10 @@ image.</p><p>See Also: -applicationIconImage</p>
[self miniaturizeAll: sender];
}
}
else
{
[self unhide:sender];
}
#endif
}
@ -2593,6 +2599,7 @@ image.</p><p>See Also: -applicationIconImage</p>
{
if (_app_is_hidden)
{
[[_main_menu itemWithTitle:@"Unhide"] setTitle:@"Hide"];
[self unhideWithoutActivation];
_unhide_on_activation = NO;
}