on xenial help sign in
fix some issues when rotating
767a88cMichael Zanetti
qml/Launcher/LauncherPanel.qml+5−3
@@ -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+18−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,12 +75,25 @@ 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
96+
83 SignalSpy {
97 SignalSpy {
84 id: signalSpy
98 id: signalSpy
85 target: LauncherModel
99 target: LauncherModel
@@ -454,6 +468,7 @@ Item {
454
468
455 verify(quickList.y >= units.gu(1));
469 verify(quickList.y >= units.gu(1));
456 verify(quickList.y + quickList.height + units.gu(1) <= launcher.height);
470 verify(quickList.y + quickList.height + units.gu(1) <= launcher.height);
471+ compare(quickList.width, units.gu(30))
457
472
458 // Click somewhere in the empty space to dismiss the quicklist
473 // Click somewhere in the empty space to dismiss the quicklist
459 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
474 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));