Remove redundant MouseAreas from controls that are Buttons#271
Merged
Conversation
5fa9522 to
b30fefd
Compare
Contributor
Author
johnny9
suggested changes
Feb 21, 2023
Collaborator
johnny9
left a comment
There was a problem hiding this comment.
hoverEnabled: true needs to be set on the buttons for hover to work.
https://doc.qt.io/qt-5/qml-qtquick-controls2-control.html#hoverEnabled-prop
Collaborator
|
States can be simplified a bit to:
This is just optional, though, being explicit has its benefits in terms of readability |
b86f893 to
f68fd69
Compare
Contributor
Author
|
Updated from b30fefd to b86f893, compare Changes:
Then updated from b86f893 to f68fd69, compare Changes:
|
f68fd69 to
80392a5
Compare
Contributor
Author
johnny9
approved these changes
Feb 22, 2023
This was referenced Feb 22, 2023
johnny9
pushed a commit
to johnny9/bitcoin-core-app
that referenced
this pull request
Jul 4, 2025
…rols that are Buttons ab6cd13 qml: remove redundant MouseAreas from controls that are Buttons (Jarol Rodriguez) Pull request description: For controls that are buttons, an additional `MouseArea` layer is unnecessary as they already have built-in event detection for actions such as [pressing](https://doc.qt.io/qt-6/qml-qtquick-controls2-abstractbutton.html#pressed-prop) and [hovering](https://doc.qt.io/qt-6/qml-qtquick-controls2-control.html#hovered-prop). By eliminating the redundant MouseAreas in the `ContinueButton`, `NavButton`, `OutlineButton`, `Setting`, and `TextButton` controls, we make their implementations cleaner. Previously, the `MouseArea` was utilized to set the controls' state, but now this is achieved through `when` statements that are bundled with the states themselves. [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/271) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/271) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/271) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/271) ACKs for top commit: johnny9: ACK ab6cd13 Tree-SHA512: 1bebc46d6a3b2449ae028e799611711197756c212899f831005b35881281b7f1a2a4d93b8cb39d683b9b90621928421e99c26491195a870b99eb260d08ce21b7
tx-signer450
added a commit
to tx-signer450/gui-qml
that referenced
this pull request
Oct 20, 2025
…rols that are Buttons ab6cd136ba9e977eb92a2234290e7c5f572ecfd7 qml: remove redundant MouseAreas from controls that are Buttons (Jarol Rodriguez) Pull request description: For controls that are buttons, an additional `MouseArea` layer is unnecessary as they already have built-in event detection for actions such as [pressing](https://doc.qt.io/qt-6/qml-qtquick-controls2-abstractbutton.html#pressed-prop) and [hovering](https://doc.qt.io/qt-6/qml-qtquick-controls2-control.html#hovered-prop). By eliminating the redundant MouseAreas in the `ContinueButton`, `NavButton`, `OutlineButton`, `Setting`, and `TextButton` controls, we make their implementations cleaner. Previously, the `MouseArea` was utilized to set the controls' state, but now this is achieved through `when` statements that are bundled with the states themselves. [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/271) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/271) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/271) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/271) ACKs for top commit: johnny9: ACK ab6cd136ba9e977eb92a2234290e7c5f572ecfd7 Tree-SHA512: 1bebc46d6a3b2449ae028e799611711197756c212899f831005b35881281b7f1a2a4d93b8cb39d683b9b90621928421e99c26491195a870b99eb260d08ce21b7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For controls that are buttons, an additional
MouseArealayer is unnecessary as they already have built-in event detection for actions such as pressing and hovering. By eliminating the redundant MouseAreas in theContinueButton,NavButton,OutlineButton,Setting, andTextButtoncontrols, we make their implementations cleaner. Previously, theMouseAreawas utilized to set the controls' state, but now this is achieved throughwhenstatements that are bundled with the states themselves.