Skip to content

Commit 8b663b4

Browse files
hebastoUdjinM6
authored andcommitted
qt, refactor: Fill up trayIconMenu before connections
This change is required for the following commits.
1 parent 272c475 commit 8b663b4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/qt/bitcoingui.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -805,15 +805,15 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
805805
#else
806806
// Note: on macOS, the Dock icon is also used to provide menu functionality
807807
// similar to one for tray icon
808+
dockIconMenu = new QMenu(this);
809+
dockIconMenu->setAsDockMenu();
810+
createIconMenu(dockIconMenu);
811+
808812
MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
809813
connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, [this] {
810814
showNormalIfMinimized();
811815
activateWindow();
812816
});
813-
dockIconMenu = new QMenu(this);
814-
dockIconMenu->setAsDockMenu();
815-
816-
createIconMenu(dockIconMenu);
817817
#endif
818818
}
819819

@@ -1044,7 +1044,8 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
10441044
// Note: On macOS, the Dock icon is used to provide the tray's functionality.
10451045
trayIconMenu->addAction(toggleHideAction);
10461046
trayIconMenu->addSeparator();
1047-
#endif
1047+
#endif // Q_OS_MAC
1048+
10481049
if (enableWallet) {
10491050
pmenu->addAction(sendCoinsMenuAction);
10501051
pmenu->addAction(coinJoinCoinsMenuAction);
@@ -1067,10 +1068,11 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
10671068
if (enableWallet) {
10681069
pmenu->addAction(showBackupsAction);
10691070
}
1070-
#ifndef Q_OS_MAC // This is built-in on macOS
1071+
#ifndef Q_OS_MAC
1072+
// Note: On macOS, the Dock icon's menu already has Quit action.
10711073
pmenu->addSeparator();
10721074
pmenu->addAction(quitAction);
1073-
#endif
1075+
#endif // Q_OS_MAC
10741076
}
10751077

10761078
void BitcoinGUI::optionsClicked()

0 commit comments

Comments
 (0)