animate toolbar hide when shown

This commit is contained in:
Marco Martin 2011-11-10 14:14:16 +01:00
parent 7da0aaecfd
commit 7b45e4e529

View File

@ -23,7 +23,11 @@ import org.kde.plasma.core 0.1 as PlasmaCore
Item{ Item{
id: toolBar id: toolBar
width: parent.width width: parent.width
height: theme.defaultFont.mSize.height*2 + frameSvg.margins.top + frameSvg.margins.bottom height: (tools && enabled) ? theme.defaultFont.mSize.height*2 + frameSvg.margins.top + frameSvg.margins.bottom : 0
visible: height > 0
Behavior on height {
PropertyAnimation { duration: 250 }
}
// The current set of tools; null if none. // The current set of tools; null if none.
property Item tools property Item tools
@ -45,6 +49,8 @@ Item{
toolBar.transition = transition toolBar.transition = transition
toolBar.tools = tools toolBar.tools = tools
} }
Connections {
target: toolBar
onToolsChanged: { onToolsChanged: {
var newContainer var newContainer
var oldContainer var oldContainer
@ -106,6 +112,7 @@ Item{
newContainer.opacity = 1 newContainer.opacity = 1
oldContainer.opacity = 0 oldContainer.opacity = 0
} }
}
PlasmaCore.FrameSvgItem { PlasmaCore.FrameSvgItem {
id: frameSvg id: frameSvg