aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-02-23 14:14:37 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-02-23 14:14:37 +0200
commitca5bd1c8e5fee29a3c2f0a3fbc879ee74f892266 (patch)
tree45ed501ab54c15a5fd3f6f0f2c8c0669c5e1700c
parent1e7dd584a5f998a5b307285a7bc29ea4ad63ebc8 (diff)
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.
-rw-r--r--src/qt/bitcoingui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index ccc0a6828c..6677c9e3b5 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -88,6 +88,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
}
+ setContextMenuPolicy(Qt::PreventContextMenu);
+
#ifdef ENABLE_WALLET
enableWallet = WalletModel::isWalletEnabled();
#endif // ENABLE_WALLET
@@ -544,7 +546,6 @@ void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
appToolBar = toolbar;
- toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
toolbar->setMovable(false);
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addAction(overviewAction);