@@ -315,8 +315,6 @@ void BitcoinGUI::createActions()
315
315
optionsAction->setStatusTip (tr (" Modify configuration options for %1" ).arg (PACKAGE_NAME));
316
316
optionsAction->setMenuRole (QAction::PreferencesRole);
317
317
optionsAction->setEnabled (false );
318
- toggleHideAction = new QAction (tr (" &Show / Hide" ), this );
319
- toggleHideAction->setStatusTip (tr (" Show or hide the main Window" ));
320
318
321
319
encryptWalletAction = new QAction (tr (" &Encrypt Wallet…" ), this );
322
320
encryptWalletAction->setStatusTip (tr (" Encrypt the private keys that belong to your wallet" ));
@@ -376,7 +374,6 @@ void BitcoinGUI::createActions()
376
374
connect (aboutAction, &QAction::triggered, this , &BitcoinGUI::aboutClicked);
377
375
connect (aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
378
376
connect (optionsAction, &QAction::triggered, this , &BitcoinGUI::optionsClicked);
379
- connect (toggleHideAction, &QAction::triggered, this , &BitcoinGUI::toggleHidden);
380
377
connect (showHelpMessageAction, &QAction::triggered, this , &BitcoinGUI::showHelpMessageClicked);
381
378
connect (openRPCConsoleAction, &QAction::triggered, this , &BitcoinGUI::showDebugWindow);
382
379
// prevents an open debug window from becoming stuck/unusable on client shutdown
@@ -627,8 +624,6 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
627
624
trayIcon->setVisible (optionsModel->getShowTrayIcon ());
628
625
}
629
626
} else {
630
- // Disable possibility to show main window via action
631
- toggleHideAction->setEnabled (false );
632
627
if (trayIconMenu)
633
628
{
634
629
// Disable context menu on tray icon
@@ -788,9 +783,10 @@ void BitcoinGUI::createTrayIconMenu()
788
783
#endif // Q_OS_MAC
789
784
790
785
// Configuration of the tray icon (or Dock icon) menu.
786
+ QAction* show_hide_action{nullptr };
791
787
#ifndef Q_OS_MAC
792
788
// Note: On macOS, the Dock icon's menu already has Show / Hide action.
793
- trayIconMenu->addAction (toggleHideAction );
789
+ show_hide_action = trayIconMenu->addAction (tr ( " Show / &Hide " ), this , &BitcoinGUI::toggleHidden );
794
790
trayIconMenu->addSeparator ();
795
791
#endif // Q_OS_MAC
796
792
0 commit comments