diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-02-25 08:59:38 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-02-25 08:59:59 +0100 |
commit | 434065a4834442defddc690bf3f59dce24be401b (patch) | |
tree | 0eaa3c3e0adfc59216336c80136f18de1bbc1a6d | |
parent | 56f06a986385b24818a53fde24c6f3a0b01f1a93 (diff) | |
parent | ca5bd1c8e5fee29a3c2f0a3fbc879ee74f892266 (diff) | |
download | bitcoin-434065a4834442defddc690bf3f59dce24be401b.tar.xz |
Merge bitcoin-core/gui#219: qt: Prevent the main window popup menu
ca5bd1c8e5fee29a3c2f0a3fbc879ee74f892266 qt: Prevent the main window popup menu (Hennadii Stepanov)
Pull request description:
https://github.com/bitcoin/bitcoin/issues/11168 is not fixed by https://github.com/bitcoin/bitcoin/pull/11169 completely, as users are allowed to right click on the menu bar:
![Screenshot from 2021-02-23 14-18-24](https://user-images.githubusercontent.com/32963518/108842753-699eb700-75e2-11eb-92ec-3aff9aa80bd4.png)
This PR moves the context menu prohibition from `QToolBar` instance to its parent `BitcoinGUI` instance, which is derived from `QMainWindow`.
ACKs for top commit:
jarolrod:
ACK ca5bd1c8e5fee29a3c2f0a3fbc879ee74f892266, tested on Ubuntu 20.04 Qt 5.12. Confirming that I can replicate the behavior described on `master` and this `PR` fixes it.
leonardojobim:
tACK https://github.com/bitcoin-core/gui/pull/219/commits/ca5bd1c8e5fee29a3c2f0a3fbc879ee74f892266
Tree-SHA512: a654ecf7ee35bb271df039be77077c1e1f9514e332587ba8622cea18da6a5b3ae8a7eb421e404ec5993c31a2f4d028e0e456fcc01facdbf61a2bc3b1e8423982
-rw-r--r-- | src/qt/bitcoingui.cpp | 3 |
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); |