Skip to content

Commit

Permalink
Merge pull request #25910 from cbjeukendrup/disable_hover_for_disable…
Browse files Browse the repository at this point in the history
…d_items

Disable hover state for all disabled UI elements
  • Loading branch information
Eism authored Jan 8, 2025
2 parents 10df670 + 0026608 commit 31c4159
Show file tree
Hide file tree
Showing 26 changed files with 39 additions and 14 deletions.
3 changes: 3 additions & 0 deletions src/appshell/qml/shared/internal/ThemeSample.qml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ Rectangle {
MouseArea {
id: mouseArea
anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: root.clicked()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Rectangle {
MouseArea {
anchors.fill: parent

enabled: gridItem.enabled
hoverEnabled: true
onContainsMouseChanged: {
if (containsMouse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Item {
id: mouseArea
anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ FocusScope {

MouseArea {
id: mouseArea

anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ ListView {
id: thumbnailMouseArea

anchors.fill: parent
enabled: thumbnailPlot.enabled
hoverEnabled: true

onClicked: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ListView {
anchors.fill: label

acceptedButtons: Qt.LeftButton | Qt.RightButton
enabled: label.enabled
hoverEnabled: true

onClicked: function(mouse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ Rectangle {

MouseArea {
id: clickableArea

anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: {
navigation.requestActiveByInteraction()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ FocusScope {

MouseArea {
id: mouseArea

anchors.fill: expandSectionRow

enabled: root.enabled
hoverEnabled: true

onClicked: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ FocusScope {
id: mouseArea
anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: function(mouse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ RadioDelegate {
implicitHeight: ListView.view ? ListView.view.height : ui.theme.defaultButtonSize
implicitWidth: ListView.view ? (ListView.view.width - (ListView.view.spacing * (ListView.view.count - 1))) / ListView.view.count
: ui.theme.defaultButtonSize
hoverEnabled: true

hoverEnabled: root.enabled

onClicked: {
navigation.requestActiveByInteraction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ FocusScope {
id: mouseArea
anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: {
navigation.requestActiveByInteraction()
root.toggled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ FocusableControl {

focusBorder.drawOutsideParent: false

mouseArea.hoverEnabled: root.visible
mouseArea.enabled: root.visible && root.enabled
mouseArea.hoverEnabled: true
mouseArea.onHoveredChanged: root.hovered(mouseArea.containsMouse, mouseArea.mouseX, mouseArea.mouseY)

mouseArea.onClicked: function(mouse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,10 @@ FocusScope {

MouseArea {
id: mouseArea

anchors.fill: parent

hoverEnabled: true

enabled: !textField.readOnly
hoverEnabled: true

onPressed: {
navigation.requestActiveByInteraction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RadioDelegate {

font: ui.theme.bodyFont

hoverEnabled: true
hoverEnabled: root.enabled

onToggled: {
navigation.requestActiveByInteraction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Slider {
implicitWidth: vertical ? prv.handleSize : prv.defaultLength
implicitHeight: vertical ? prv.defaultLength : prv.handleSize

hoverEnabled: true
hoverEnabled: root.enabled
wheelEnabled: true

QtObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ FocusScope {

MouseArea {
id: clickableArea

anchors.fill: parent

enabled: root.enabled
propagateComposedEvents: true
hoverEnabled: true
cursorShape: Qt.IBeamCursor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ FocusScope {
height: parent.height
width: clearTextButtonItem.visible ? parent.width - clearTextButtonItem.width : parent.width

enabled: root.enabled
propagateComposedEvents: true
hoverEnabled: true
cursorShape: root.readOnly ? Qt.ArrowCursor : Qt.IBeamCursor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ FocusScope {
id: mouseArea
anchors.fill: parent

enabled: root.enabled
hoverEnabled: true
onClicked: {
navigation.requestActiveByInteraction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Column {
id: increaseMouseArea
anchors.fill: parent

enabled: increaseButton.enabled
hoverEnabled: true
preventStealing: true

Expand Down Expand Up @@ -130,6 +131,7 @@ Column {
id: decreaseMouseArea
anchors.fill: parent

enabled: decreaseButton.enabled
hoverEnabled: true
preventStealing: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ Item {
MouseArea {
id: mouseAreaItem
anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: root.clicked()

onContainsMouseChanged: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Item {
MouseArea {
id: mouseArea
anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ Column {

MouseArea {
id: mouseArea

anchors.fill: parent

enabled: mainContentArea.enabled
hoverEnabled: true

onPressed: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,9 @@ Item {

MouseArea {
id: rootMouseArea

anchors.fill: parent

enabled: parent.enabled
acceptedButtons: Qt.NoButton
hoverEnabled: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ MixerPanelSection {
id: mouseArea
anchors.fill: parent

enabled: parent.enabled
hoverEnabled: true

onContainsMouseChanged: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Item {
id: mouseArea
anchors.fill: root

enabled: root.enabled
hoverEnabled: true

onContainsMouseChanged: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ FocusScope {

MouseArea {
id: mouseArea

anchors.fill: parent

enabled: root.enabled
hoverEnabled: true

onClicked: {
Expand Down

0 comments on commit 31c4159

Please sign in to comment.