From 24f527f3fedd853428fabb28c3b2f697bc51b2cf Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 8 Nov 2011 15:24:10 +0100 Subject: [PATCH] sync the roundshadow element --- .../platformcomponents/touch/RoundShadow.qml | 46 +++++++++++++++++-- .../plasmacomponents/qml/RoundShadow.qml | 2 +- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/declarativeimports/plasmacomponents/platformcomponents/touch/RoundShadow.qml b/declarativeimports/plasmacomponents/platformcomponents/touch/RoundShadow.qml index 12b53f4a7..1ea1465ec 100644 --- a/declarativeimports/plasmacomponents/platformcomponents/touch/RoundShadow.qml +++ b/declarativeimports/plasmacomponents/platformcomponents/touch/RoundShadow.qml @@ -24,13 +24,29 @@ import org.kde.plasma.core 0.1 as PlasmaCore Item { id: main state: parent.state + property alias imagePath: shadowSvg.imagePath + property string hoverElement: "hover" + property string focusElement: "focus" + property alias shadowElement: shadow.elementId + + PlasmaCore.Svg { + id: shadowSvg + imagePath: "widgets/actionbutton" + } + + PlasmaCore.SvgItem { + id: hover + svg: shadowSvg + elementId: "hover" + + anchors.fill: parent + + opacity: 0 + } PlasmaCore.SvgItem { id: shadow - svg: PlasmaCore.Svg { - id: shadowSvg - imagePath: "widgets/actionbutton" - } + svg: shadowSvg elementId: "shadow" anchors.fill: parent @@ -43,6 +59,23 @@ Item { target: shadow opacity: 1 } + PropertyChanges { + target: hover + opacity: 0 + elementId: hoverElement + } + }, + State { + name: "focus" + PropertyChanges { + target: shadow + opacity: 0 + } + PropertyChanges { + target: hover + opacity: 1 + elementId: focusElement + } }, State { name: "hidden" @@ -50,6 +83,11 @@ Item { target: shadow opacity: 0 } + PropertyChanges { + target: hover + opacity: 0 + elementId: hoverElement + } } ] diff --git a/declarativeimports/plasmacomponents/qml/RoundShadow.qml b/declarativeimports/plasmacomponents/qml/RoundShadow.qml index 8c20a9d5a..f11e54de9 100644 --- a/declarativeimports/plasmacomponents/qml/RoundShadow.qml +++ b/declarativeimports/plasmacomponents/qml/RoundShadow.qml @@ -90,7 +90,7 @@ Item { } }, State { - name: "hover" + name: "hidden" PropertyChanges { target: shadow opacity: 0