From fb40d137f87e569cc968911d97212b897b8294c9 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 6 Dec 2017 14:11:06 +0100 Subject: [PATCH] Hover effects for inlineButton --- components/InlineButton.qml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/components/InlineButton.qml b/components/InlineButton.qml index 9e3f3c04..11439369 100644 --- a/components/InlineButton.qml +++ b/components/InlineButton.qml @@ -42,11 +42,6 @@ Item { property alias text: inlineText.text signal clicked() - anchors.top: parent.top - anchors.right: parent.right - anchors.rightMargin: 8 - anchors.topMargin: 8 - function doClick() { // Android workaround releaseFocus(); @@ -76,9 +71,18 @@ Item { MouseArea { id: buttonArea - cursorShape: Qt.PointingHandCursor + cursorShape: rect.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor + hoverEnabled: true anchors.fill: parent onClicked: doClick() + onEntered: { + rect.color = "#707070"; + rect.opacity = 0.8; + } + onExited: { + rect.opacity = 1.0; + rect.color = "#808080"; + } } }