on xenial help sign in
fix some issues when rotating
commit767a88cc89f994a172cd228720cb654732c370b9 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 5 Feb 2015, 15:03 (12 years ago) parent5fda2b4
2 files changed+23−6
qml/Launcher/LauncherPanel.qml+5−3 tests/qmltests/Launcher/tst_Launcher.qml+18−3
qml/Launcher/LauncherPanel.qml+5−3
@@ -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+18−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,12 +75,25 @@ 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
96+
8397 SignalSpy {
8498 id: signalSpy
8599 target: LauncherModel
@@ -454,6 +468,7 @@ Item {
454468
455469 verify(quickList.y >= units.gu(1));
456470 verify(quickList.y + quickList.height + units.gu(1) <= launcher.height);
471+ compare(quickList.width, units.gu(30))
457472
458473 // Click somewhere in the empty space to dismiss the quicklist
459474 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));