on xenial help sign in
Indicators: set menu height binding while fully open/closed, fixes dynamic grid unit bug.

Before this, if the grid units changed, the menu "height" remained fixed, but minimizedPanelHeight and openedHeight would adapt. This would mean for case phone (GU 22) to desktop (GU8): a. if the menu was closed, it would remain at the old height (3*22=66pixels), while the panel would shrink (3*8 = 24). This would mean the menu was technically open, and would block input to windows b. if the menu was opened, it would remain open at the old phone height, and not grow to the new screen height. Approved by: Michael Terry

commit0459278d21e90bf174a53a2c035ad541c6657419 authorGerry Boland <gerry.boland@canonical.com> dateFri 29 Apr 2016, 20:06 (10 years ago) parente66b43a34d63ad
1 file changed+20−10
qml/Panel/IndicatorsMenu.qml+20−10
qml/Panel/IndicatorsMenu.qml+20−10
@@ -43,18 +43,28 @@ Showable {
4343
4444 // TODO: Perhaps we need a animation standard for showing/hiding? Each showable seems to
4545 // use its own values. Need to ask design about this.
46− showAnimation: StandardAnimation {
47− property: "height"
48− to: openedHeight
49− duration: UbuntuAnimation.BriskDuration
50− easing.type: Easing.OutCubic
46+ showAnimation: SequentialAnimation {
47+ StandardAnimation {
48+ target: root
49+ property: "height"
50+ to: openedHeight
51+ duration: UbuntuAnimation.BriskDuration
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; } ) }
5156 }
5257
53− hideAnimation: StandardAnimation {
54− property: "height"
55− to: minimizedPanelHeight
56− duration: UbuntuAnimation.BriskDuration
57− easing.type: Easing.OutCubic
58+ hideAnimation: SequentialAnimation {
59+ StandardAnimation {
60+ target: root
61+ property: "height"
62+ to: minimizedPanelHeight
63+ duration: UbuntuAnimation.BriskDuration
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; } ) }
5868 }
5969
6070 height: minimizedPanelHeight