@@ -400,16 +400,18 @@ void BitcoinGUI::createMenuBar()
400400
401401 QMenu* window_menu = appMenuBar->addMenu (tr (" &Window" ));
402402
403- QAction* minimize_action = window_menu->addAction (tr (" Minimize" ), [] {
403+ QAction* minimize_action = window_menu->addAction (tr (" Minimize" ));
404+ minimize_action->setShortcut (QKeySequence (Qt::CTRL + Qt::Key_M));
405+ connect (minimize_action, &QAction::triggered, [] {
404406 qApp->focusWindow ()->showMinimized ();
405- }, QKeySequence (Qt::CTRL + Qt::Key_M));
406-
407+ });
407408 connect (qApp, &QApplication::focusWindowChanged, [minimize_action] (QWindow* window) {
408409 minimize_action->setEnabled (window != nullptr && (window->flags () & Qt::Dialog) != Qt::Dialog && window->windowState () != Qt::WindowMinimized);
409410 });
410411
411412#ifdef Q_OS_MAC
412- QAction* zoom_action = window_menu->addAction (tr (" Zoom" ), [] {
413+ QAction* zoom_action = window_menu->addAction (tr (" Zoom" ));
414+ connect (zoom_action, &QAction::triggered, [] {
413415 QWindow* window = qApp->focusWindow ();
414416 if (window->windowState () != Qt::WindowMaximized) {
415417 window->showMaximized ();
@@ -422,7 +424,8 @@ void BitcoinGUI::createMenuBar()
422424 zoom_action->setEnabled (window != nullptr );
423425 });
424426#else
425- QAction* restore_action = window_menu->addAction (tr (" Restore" ), [] {
427+ QAction* restore_action = window_menu->addAction (tr (" Restore" ));
428+ connect (restore_action, &QAction::triggered, [] {
426429 qApp->focusWindow ()->showNormal ();
427430 });
428431
@@ -433,7 +436,8 @@ void BitcoinGUI::createMenuBar()
433436
434437 if (walletFrame) {
435438 window_menu->addSeparator ();
436- window_menu->addAction (tr (" Main Window" ), [this ] {
439+ QAction* main_window_action = window_menu->addAction (tr (" Main Window" ));
440+ connect (main_window_action, &QAction::triggered, [this ] {
437441 GUIUtil::bringToFront (this );
438442 });
439443
@@ -444,7 +448,8 @@ void BitcoinGUI::createMenuBar()
444448
445449 window_menu->addSeparator ();
446450 for (RPCConsole::TabTypes tab_type : rpcConsole->tabs ()) {
447- window_menu->addAction (rpcConsole->tabTitle (tab_type), [this , tab_type] {
451+ QAction* tab_action = window_menu->addAction (rpcConsole->tabTitle (tab_type));
452+ connect (tab_action, &QAction::triggered, [this , tab_type] {
448453 rpcConsole->setTabFocus (tab_type);
449454 showDebugWindow ();
450455 });
0 commit comments