sync the roundshadow element

This commit is contained in:
Marco Martin 2011-11-08 15:24:10 +01:00
parent a62ce8814a
commit 24f527f3fe
2 changed files with 43 additions and 5 deletions

View File

@ -24,13 +24,29 @@ import org.kde.plasma.core 0.1 as PlasmaCore
Item { Item {
id: main id: main
state: parent.state state: parent.state
property alias imagePath: shadowSvg.imagePath
property string hoverElement: "hover"
property string focusElement: "focus"
property alias shadowElement: shadow.elementId
PlasmaCore.SvgItem { PlasmaCore.Svg {
id: shadow
svg: PlasmaCore.Svg {
id: shadowSvg id: shadowSvg
imagePath: "widgets/actionbutton" imagePath: "widgets/actionbutton"
} }
PlasmaCore.SvgItem {
id: hover
svg: shadowSvg
elementId: "hover"
anchors.fill: parent
opacity: 0
}
PlasmaCore.SvgItem {
id: shadow
svg: shadowSvg
elementId: "shadow" elementId: "shadow"
anchors.fill: parent anchors.fill: parent
@ -43,6 +59,23 @@ Item {
target: shadow target: shadow
opacity: 1 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 { State {
name: "hidden" name: "hidden"
@ -50,6 +83,11 @@ Item {
target: shadow target: shadow
opacity: 0 opacity: 0
} }
PropertyChanges {
target: hover
opacity: 0
elementId: hoverElement
}
} }
] ]

View File

@ -90,7 +90,7 @@ Item {
} }
}, },
State { State {
name: "hover" name: "hidden"
PropertyChanges { PropertyChanges {
target: shadow target: shadow
opacity: 0 opacity: 0