Skip to content

Commit ca5bd1c

Browse files
committed
qt: Prevent the main window popup menu
By default, a popup menu contains checkable entries for the toolbars and dock widgets present in the main window. This allows users to accidentally hide the toolbar.
1 parent 1e7dd58 commit ca5bd1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/qt/bitcoingui.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
8888
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
8989
}
9090

91+
setContextMenuPolicy(Qt::PreventContextMenu);
92+
9193
#ifdef ENABLE_WALLET
9294
enableWallet = WalletModel::isWalletEnabled();
9395
#endif // ENABLE_WALLET
@@ -544,7 +546,6 @@ void BitcoinGUI::createToolBars()
544546
{
545547
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
546548
appToolBar = toolbar;
547-
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
548549
toolbar->setMovable(false);
549550
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
550551
toolbar->addAction(overviewAction);

0 commit comments

Comments
 (0)