Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

26645: Fixed Undo/Redo buttons' hover state when disabled #26671

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/framework/uicomponents/qml/Muse/UiComponents/FlatButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ FocusScope {
states: [
State {
name: "PRESSED"
when: mouseArea.pressed
when: mouseArea.pressed && root.enabled

PropertyChanges {
target: background
Expand All @@ -170,7 +170,7 @@ FocusScope {

State {
name: "HOVERED"
when: mouseArea.containsMouse && !mouseArea.pressed
when: mouseArea.containsMouse && !mouseArea.pressed && root.enabled

PropertyChanges {
target: background
Expand Down Expand Up @@ -299,7 +299,10 @@ FocusScope {
id: mouseArea
anchors.fill: parent

enabled: root.enabled
// Disabling the MouseArea together with the button has side effects if the button
// becomes disabled on its own click. See issue #26645 and the PR for it for details.
//enabled: root.enabled

hoverEnabled: true

onClicked: function(mouse) {
Expand All @@ -318,7 +321,7 @@ FocusScope {
return
}

if (mouseArea.containsMouse) {
if (mouseArea.containsMouse && root.enabled) {
ui.tooltip.show(root, root.toolTipTitle, root.toolTipDescription, root.toolTipShortcut)
} else {
ui.tooltip.hide(root)
Expand Down
Loading