on xenial help sign in
Indicators: set menu height binding while fully open/closed, fixes dynamic grid unit bug.
0459278Gerry Boland
qml/Panel/IndicatorsMenu.qml+20−10
@@ -43,18 +43,28 @@ Showable {
43
43
44 // TODO: Perhaps we need a animation standard for showing/hiding? Each showable seems to
44 // TODO: Perhaps we need a animation standard for showing/hiding? Each showable seems to
45 // use its own values. Need to ask design about this.
45 // use its own values. Need to ask design about this.
46+ showAnimation: SequentialAnimation {
46− showAnimation: StandardAnimation {
47+ StandardAnimation {
48+ target: root
47− property: "height"
49+ property: "height"
48− to: openedHeight
50+ to: openedHeight
49− duration: UbuntuAnimation.BriskDuration
51+ duration: UbuntuAnimation.BriskDuration
50− easing.type: Easing.OutCubic
52+ easing.type: Easing.OutCubic
53+ }
54+ // set binding in case units.gu changes while menu open, so height correctly adjusted to fit
55+ ScriptAction { script: root.height = Qt.binding( function(){ return root.openedHeight; } ) }
51 }
56 }
52
57
58+ hideAnimation: SequentialAnimation {
53− hideAnimation: StandardAnimation {
59+ StandardAnimation {
60+ target: root
54− property: "height"
61+ property: "height"
55− to: minimizedPanelHeight
62+ to: minimizedPanelHeight
56− duration: UbuntuAnimation.BriskDuration
63+ duration: UbuntuAnimation.BriskDuration
57− easing.type: Easing.OutCubic
64+ easing.type: Easing.OutCubic
65+ }
66+ // set binding in case units.gu changes while menu closed, so menu adjusts to fit
67+ ScriptAction { script: root.height = Qt.binding( function(){ return root.minimizedPanelHeight; } ) }
58 }
68 }
59
69
60 height: minimizedPanelHeight
70 height: minimizedPanelHeight