mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
feat: add "Show Toolbar" toggle (#4419)
This commit is contained in:
parent
1851b80d8c
commit
febc5b7ef4
3 changed files with 17 additions and 1 deletions
|
@ -516,7 +516,7 @@
|
|||
</menuItem>
|
||||
<menuItem title="Hide Toolbar" id="1222">
|
||||
<connections>
|
||||
<action selector="toggleToolbarShown:" target="-1" id="1251"/>
|
||||
<action selector="toggleToolbarShown:" target="206" id="1251"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Customize Toolbar…" id="545">
|
||||
|
|
|
@ -153,6 +153,7 @@ typedef NS_ENUM(unsigned int, addType) { //
|
|||
|
||||
- (IBAction)toggleStatusBar:(id)sender;
|
||||
- (IBAction)toggleFilterBar:(id)sender;
|
||||
- (IBAction)toggleToolbarShown:(id)sender;
|
||||
- (void)focusFilterField;
|
||||
|
||||
- (void)allToolbarClicked:(id)sender;
|
||||
|
|
|
@ -4125,6 +4125,11 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
|||
[self updateMainWindow];
|
||||
}
|
||||
|
||||
- (IBAction)toggleToolbarShown:(id)sender
|
||||
{
|
||||
[self.fWindow toggleToolbarShown:sender];
|
||||
}
|
||||
|
||||
- (void)focusFilterField
|
||||
{
|
||||
if (!self.fFilterBar)
|
||||
|
@ -4814,6 +4819,16 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
|||
return self.fWindow.visible;
|
||||
}
|
||||
|
||||
// enable toggle toolbar
|
||||
if (action == @selector(toggleToolbarShown:))
|
||||
{
|
||||
NSString* title = !self.fWindow.toolbar.isVisible ? NSLocalizedString(@"Show Toolbar", "View menu -> Toolbar") :
|
||||
NSLocalizedString(@"Hide Toolbar", "View menu -> Toolbar");
|
||||
menuItem.title = title;
|
||||
|
||||
return self.fWindow.visible;
|
||||
}
|
||||
|
||||
//enable prev/next filter button
|
||||
if (action == @selector(switchFilter:))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue