File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -786,7 +786,7 @@ void BitcoinGUI::createTrayIconMenu()
786
786
QAction* show_hide_action{nullptr };
787
787
#ifndef Q_OS_MAC
788
788
// Note: On macOS, the Dock icon's menu already has Show / Hide action.
789
- show_hide_action = trayIconMenu->addAction (tr ( " Show / &Hide " ), this , &BitcoinGUI::toggleHidden);
789
+ show_hide_action = trayIconMenu->addAction (QString ( ), this , &BitcoinGUI::toggleHidden);
790
790
trayIconMenu->addSeparator ();
791
791
#endif // Q_OS_MAC
792
792
@@ -821,6 +821,17 @@ void BitcoinGUI::createTrayIconMenu()
821
821
});
822
822
trayIconMenu->setAsDockMenu ();
823
823
#endif // Q_OS_MAC
824
+
825
+ connect (
826
+ // Using QSystemTrayIcon::Context is not reliable.
827
+ // See https://bugreports.qt.io/browse/QTBUG-91697
828
+ trayIconMenu.get (), &QMenu::aboutToShow,
829
+ [this , show_hide_action] {
830
+ if (show_hide_action) show_hide_action->setText (
831
+ (!isHidden () && !isMinimized () && !GUIUtil::isObscured (this )) ?
832
+ tr (" &Hide" ) :
833
+ tr (" S&how" ));
834
+ });
824
835
}
825
836
826
837
void BitcoinGUI::optionsClicked ()
You can’t perform that action at this time.
0 commit comments