on xenial help sign in
rework launcher quicklist visuals to fit new design Fixes: 1368660

Approved by: Michael Terry

commit9487d091607796b273361e9d4a94baa943d5df89 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 4 Nov 2014, 12:52 (12 years ago) parent432b850f4ac106
3 files changed+22−21
qml/Launcher/LauncherPanel.qml+16−15 qml/Launcher/graphics/quicklist_tooltip@30.png tests/qmltests/Launcher/tst_Launcher.qml+6−6
qml/Launcher/LauncherPanel.qml+16−15
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−import Ubuntu.Components.ListItems 0.1 as ListItems
17+import QtQuick 2.3
18+import Ubuntu.Components 1.1
19+import Ubuntu.Components.ListItems 1.0 as ListItems
2020import Unity.Launcher 0.1
2121import Ubuntu.Components.Popups 0.1
2222import "../Components/ListItems"
@@ -479,7 +479,7 @@ Rectangle {
479479 id: quickListShape
480480 objectName: "quickListShape"
481481 anchors.fill: quickList
482− opacity: quickList.state === "open" ? 0.8 : 0
482+ opacity: quickList.state === "open" ? 0.96 : 0
483483 visible: opacity > 0
484484 rotation: root.rotation
485485
@@ -491,15 +491,15 @@ Rectangle {
491491
492492 Image {
493493 anchors {
494− right: parent.left
495− rightMargin: -units.dp(4)
494+ left: parent.left
495+ leftMargin: (quickList.item.width - units.gu(1)) / 2 - width / 2
496496 verticalCenter: parent.verticalCenter
497− verticalCenterOffset: -quickList.offset
497+ verticalCenterOffset: (parent.height / 2 + units.dp(3)) * (quickList.offset > 0 ? 1 : -1)
498498 }
499499 height: units.gu(1)
500500 width: units.gu(2)
501501 source: "graphics/quicklist_tooltip.png"
502− rotation: 90
502+ rotation: quickList.offset > 0 ? 0 : 180
503503 }
504504
505505 InverseMouseArea {
@@ -515,16 +515,16 @@ Rectangle {
515515 Rectangle {
516516 id: quickList
517517 objectName: "quickList"
518− color: "#221e1c"
518+ color: "#f5f5f5"
519519 width: units.gu(30)
520520 height: quickListColumn.height
521521 visible: quickListShape.visible
522522 anchors {
523− left: root.inverted ? undefined : parent.right
524− right: root.inverted ? parent.left : undefined
523+ left: root.inverted ? undefined : parent.left
524+ right: root.inverted ? parent.right : undefined
525525 margins: units.gu(1)
526526 }
527− y: itemCenter - (height / 2) + offset
527+ y: itemCenter + offset
528528 rotation: root.rotation
529529
530530 property var model
@@ -533,8 +533,9 @@ Rectangle {
533533
534534 // internal
535535 property int itemCenter: item ? root.mapFromItem(quickList.item).y + (item.height / 2) : units.gu(1)
536− property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
537− itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0
536+ property int offset: itemCenter + (item.height/2) + height + units.gu(1) > parent.height ?
537+ -(item.height/2) - height - units.gu(.5) :
538+ (item.height/2) + units.gu(.5)
538539
539540 Column {
540541 id: quickListColumn
@@ -553,7 +554,7 @@ Rectangle {
553554 // FIXME: This is a workaround for the theme not being context sensitive. I.e. the
554555 // ListItems don't know that they are sitting in a themed Popover where the color
555556 // needs to be inverted.
556− __foregroundColor: Theme.palette.selected.backgroundText
557+ __foregroundColor: "black"
557558
558559 onClicked: {
559560 if (!model.clickable) {
qml/Launcher/graphics/quicklist_tooltip@30.png

Binary file not shown.

tests/qmltests/Launcher/tst_Launcher.qml+6−6
@@ -431,20 +431,20 @@ Item {
431431 }
432432
433433 // Doing longpress
434− mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2)
435− tryCompare(quickListShape, "opacity", 0.8)
434+ mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2);
435+ tryCompare(quickListShape, "opacity", 0.96);
436436 mouseRelease(draggedItem);
437437
438− verify(quickList.y >= units.gu(1))
439− verify(quickList.y + quickList.height + units.gu(1) <= launcher.height)
438+ verify(quickList.y >= units.gu(1));
439+ verify(quickList.y + quickList.height + units.gu(1) <= launcher.height);
440440
441441 // Click somewhere in the empty space to dismiss the quicklist
442442 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
443− tryCompare(quickListShape, "visible", false)
443+ tryCompare(quickListShape, "visible", false);
444444
445445 // Click somewhere in the empty space to dismiss the launcher
446446 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
447− waitUntilLauncherDisappears()
447+ waitUntilLauncherDisappears();
448448 }
449449
450450 function test_quicklist_click_data() {