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 {
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
}
}
]

View File

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