on xenial help sign in
Launcher fixes for windowed mode

* When rotating the launcher because switching back and forth between staged/windowed mode, it would break the quicklist width * Quicklist in rotated launcher painted the arrow on the wrong end * snap animation fixed for a larger amount icons in the launcher. Approved by: Daniel d'Andrada, PS Jenkins bot

commit9f25efecd4c1d5d5f1bbe3a1a80b1d02357a0722 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 11 Feb 2015, 17:11 (12 years ago) parentd4a51788e3373d
2 files changed+24−8
qml/Launcher/LauncherPanel.qml+7−5 tests/qmltests/Launcher/tst_Launcher.qml+17−3
qml/Launcher/LauncherPanel.qml+7−5
@@ -149,14 +149,14 @@ Rectangle {
149149 id: snapToBottomAnimation
150150 target: launcherListView
151151 property: "contentY"
152− to: launcherListView.originY
152+ to: launcherListView.originY + launcherListView.topMargin
153153 }
154154
155155 UbuntuNumberAnimation {
156156 id: snapToTopAnimation
157157 target: launcherListView
158158 property: "contentY"
159− to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY
159+ to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY - launcherListView.topMargin
160160 }
161161
162162 displaced: Transition {
@@ -521,12 +521,12 @@ Rectangle {
521521 left: parent.left
522522 leftMargin: (quickList.item.width - units.gu(1)) / 2 - width / 2
523523 verticalCenter: parent.verticalCenter
524− verticalCenterOffset: (parent.height / 2 + units.dp(3)) * (quickList.offset > 0 ? 1 : -1)
524+ verticalCenterOffset: (parent.height / 2 + units.dp(3)) * (quickList.offset > 0 ? 1 : -1) * (root.inverted ? 1 : -1)
525525 }
526526 height: units.gu(1)
527527 width: units.gu(2)
528528 source: "graphics/quicklist_tooltip.png"
529− rotation: quickList.offset > 0 ? 0 : 180
529+ rotation: (quickList.offset > 0 ? 0 : 180) + (root.inverted ? 0 : 180)
530530 }
531531
532532 InverseMouseArea {
@@ -543,7 +543,9 @@ Rectangle {
543543 id: quickList
544544 objectName: "quickList"
545545 color: "#f5f5f5"
546− width: units.gu(30)
546+ // Because we're setting left/right anchors depending on orientation, it will break the
547+ // width setting after rotating twice. This makes sure we also re-apply width on rotation
548+ width: root.inverted ? units.gu(30) : units.gu(30)
547549 height: quickListColumn.height
548550 visible: quickListShape.visible
549551 anchors {
tests/qmltests/Launcher/tst_Launcher.qml+17−3
@@ -15,6 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18+import QtQuick.Layouts 1.1
1819import QtTest 1.0
1920import Unity.Test 0.1 as UT
2021import Ubuntu.Components 1.1
@@ -74,10 +75,22 @@ Item {
7475 }
7576 }
7677
77− Button {
78+ ColumnLayout {
7879 anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) }
79− text: "emit hinting signal"
80− onClicked: LauncherModel.emitHint()
80+ spacing: units.gu(1)
81+ width: units.gu(20)
82+
83+ Button {
84+ text: "emit hinting signal"
85+ onClicked: LauncherModel.emitHint()
86+ Layout.fillWidth: true
87+ }
88+
89+ Button {
90+ text: "rotate"
91+ onClicked: launcherLoader.item.inverted = !launcherLoader.item.inverted
92+ Layout.fillWidth: true
93+ }
8194 }
8295
8396 SignalSpy {
@@ -454,6 +467,7 @@ Item {
454467
455468 verify(quickList.y >= units.gu(1));
456469 verify(quickList.y + quickList.height + units.gu(1) <= launcher.height);
470+ compare(quickList.width, units.gu(30));
457471
458472 // Click somewhere in the empty space to dismiss the quicklist
459473 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));