on xenial help sign in
Launcher fixes for windowed mode
9f25efeMichael Zanetti
qml/Launcher/LauncherPanel.qml+7−5
@@ -149,14 +149,14 @@ Rectangle {
149 id: snapToBottomAnimation
149 id: snapToBottomAnimation
150 target: launcherListView
150 target: launcherListView
151 property: "contentY"
151 property: "contentY"
152− to: launcherListView.originY
152+ to: launcherListView.originY + launcherListView.topMargin
153 }
153 }
154
154
155 UbuntuNumberAnimation {
155 UbuntuNumberAnimation {
156 id: snapToTopAnimation
156 id: snapToTopAnimation
157 target: launcherListView
157 target: launcherListView
158 property: "contentY"
158 property: "contentY"
159− to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY
159+ to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY - launcherListView.topMargin
160 }
160 }
161
161
162 displaced: Transition {
162 displaced: Transition {
@@ -521,12 +521,12 @@ Rectangle {
521 left: parent.left
521 left: parent.left
522 leftMargin: (quickList.item.width - units.gu(1)) / 2 - width / 2
522 leftMargin: (quickList.item.width - units.gu(1)) / 2 - width / 2
523 verticalCenter: parent.verticalCenter
523 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)
525 }
525 }
526 height: units.gu(1)
526 height: units.gu(1)
527 width: units.gu(2)
527 width: units.gu(2)
528 source: "graphics/quicklist_tooltip.png"
528 source: "graphics/quicklist_tooltip.png"
529− rotation: quickList.offset > 0 ? 0 : 180
529+ rotation: (quickList.offset > 0 ? 0 : 180) + (root.inverted ? 0 : 180)
530 }
530 }
531
531
532 InverseMouseArea {
532 InverseMouseArea {
@@ -543,7 +543,9 @@ Rectangle {
543 id: quickList
543 id: quickList
544 objectName: "quickList"
544 objectName: "quickList"
545 color: "#f5f5f5"
545 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)
547 height: quickListColumn.height
549 height: quickListColumn.height
548 visible: quickListShape.visible
550 visible: quickListShape.visible
549 anchors {
551 anchors {
tests/qmltests/Launcher/tst_Launcher.qml+17−3
@@ -15,6 +15,7 @@
15 */
15 */
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18+import QtQuick.Layouts 1.1
18import QtTest 1.0
19import QtTest 1.0
19import Unity.Test 0.1 as UT
20import Unity.Test 0.1 as UT
20import Ubuntu.Components 1.1
21import Ubuntu.Components 1.1
@@ -74,10 +75,22 @@ Item {
74 }
75 }
75 }
76 }
76
77
77− Button {
78+ ColumnLayout {
78 anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) }
79 anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) }
80+ spacing: units.gu(1)
81+ width: units.gu(20)
82+
83+ Button {
79− text: "emit hinting signal"
84+ text: "emit hinting signal"
80− onClicked: LauncherModel.emitHint()
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+ }
81 }
94 }
82
95
83 SignalSpy {
96 SignalSpy {
@@ -454,6 +467,7 @@ Item {
454
467
455 verify(quickList.y >= units.gu(1));
468 verify(quickList.y >= units.gu(1));
456 verify(quickList.y + quickList.height + units.gu(1) <= launcher.height);
469 verify(quickList.y + quickList.height + units.gu(1) <= launcher.height);
470+ compare(quickList.width, units.gu(30));
457
471
458 // Click somewhere in the empty space to dismiss the quicklist
472 // Click somewhere in the empty space to dismiss the quicklist
459 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
473 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));