forked from qt-creator/qt-creator
QmlDesigner: Fix button tooltip blocking event
Fix HelperWidgets AbstractButton nested TooplTipArea blocking hover events from the actual control. Task-number: QDS-4828 Change-Id: Ibd390c98805a49f903663b6c38091f727c2b7ec9 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
0408b4a757
commit
d3b6777d12
@@ -32,6 +32,8 @@ StudioControls.AbstractButton {
|
||||
|
||||
property alias tooltip: toolTipArea.tooltip
|
||||
|
||||
hover: toolTipArea.containsMouse
|
||||
|
||||
ToolTipArea {
|
||||
id: toolTipArea
|
||||
anchors.fill: parent
|
||||
|
@@ -31,6 +31,7 @@ T.AbstractButton {
|
||||
id: myButton
|
||||
|
||||
property bool globalHover: false
|
||||
property bool hover: myButton.hovered
|
||||
|
||||
property alias buttonIcon: buttonIcon.text
|
||||
property alias iconColor: buttonIcon.color
|
||||
@@ -51,7 +52,7 @@ T.AbstractButton {
|
||||
z: myButton.checked ? 10 : 3
|
||||
activeFocusOnTab: false
|
||||
|
||||
onHoveredChanged: {
|
||||
onHoverChanged: {
|
||||
if (parent !== undefined && parent.hoverCallback !== undefined && myButton.enabled)
|
||||
parent.hoverCallback()
|
||||
}
|
||||
@@ -119,7 +120,7 @@ T.AbstractButton {
|
||||
states: [
|
||||
State {
|
||||
name: "default"
|
||||
when: myButton.enabled && !myButton.globalHover && !myButton.hovered
|
||||
when: myButton.enabled && !myButton.globalHover && !myButton.hover
|
||||
&& !myButton.pressed && !myButton.checked
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
@@ -132,7 +133,7 @@ T.AbstractButton {
|
||||
},
|
||||
State {
|
||||
name: "globalHover"
|
||||
when: myButton.globalHover && !myButton.hovered && !myButton.pressed && myButton.enabled
|
||||
when: myButton.globalHover && !myButton.hover && !myButton.pressed && myButton.enabled
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundGlobalHover
|
||||
@@ -140,7 +141,7 @@ T.AbstractButton {
|
||||
},
|
||||
State {
|
||||
name: "hover"
|
||||
when: myButton.hovered && !myButton.pressed && myButton.enabled
|
||||
when: myButton.hover && !myButton.pressed && myButton.enabled
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundHover
|
||||
@@ -148,7 +149,7 @@ T.AbstractButton {
|
||||
},
|
||||
State {
|
||||
name: "press"
|
||||
when: myButton.hovered && myButton.pressed
|
||||
when: myButton.hover && myButton.pressed
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundInteraction
|
||||
|
@@ -56,8 +56,8 @@ Row {
|
||||
var hover = false
|
||||
|
||||
for (var i = 0; i < children.length; ++i) {
|
||||
if (children[i].hovered !== undefined)
|
||||
hover = hover || children[i].hovered
|
||||
if (children[i].hover !== undefined)
|
||||
hover = hover || children[i].hover
|
||||
}
|
||||
|
||||
myButtonRow.childHover = hover
|
||||
|
Reference in New Issue
Block a user