mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
gui: macOS, make appMenuBar part of the main app window
By moving the appMenuBar destruction responsibility to the QT framework, we ensure the disconnection of the submenus signals prior to the destruction of the main app window. The standalone menu bar may have served a purpose in earlier versions when it didn't contain actions that directly open specific screens within the main application window. However, at present, all the actions within the appMenuBar lead to the opening of screens within the main app window. So, the absence of a main app window makes these actions essentially pointless.
This commit is contained in:
parent
e14cc8fc69
commit
bae209e387
1 changed files with 0 additions and 7 deletions
|
@ -239,7 +239,6 @@ BitcoinGUI::~BitcoinGUI()
|
||||||
trayIcon->hide();
|
trayIcon->hide();
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
delete m_app_nap_inhibitor;
|
delete m_app_nap_inhibitor;
|
||||||
delete appMenuBar;
|
|
||||||
MacDockIconHandler::cleanup();
|
MacDockIconHandler::cleanup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -470,13 +469,7 @@ void BitcoinGUI::createActions()
|
||||||
|
|
||||||
void BitcoinGUI::createMenuBar()
|
void BitcoinGUI::createMenuBar()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MACOS
|
|
||||||
// Create a decoupled menu bar on Mac which stays even if the window is closed
|
|
||||||
appMenuBar = new QMenuBar();
|
|
||||||
#else
|
|
||||||
// Get the main window's menu bar on other platforms
|
|
||||||
appMenuBar = menuBar();
|
appMenuBar = menuBar();
|
||||||
#endif
|
|
||||||
|
|
||||||
// Configure the menus
|
// Configure the menus
|
||||||
QMenu *file = appMenuBar->addMenu(tr("&File"));
|
QMenu *file = appMenuBar->addMenu(tr("&File"));
|
||||||
|
|
Loading…
Reference in a new issue