@@ -41,7 +41,10 @@ Rectangle {
4141 signal kbdNavigationCancelled()
4242
4343 onXChanged: {
44− if (quickList.state == "open") {
44+ if (quickList.state === "open") {
45+ quickList.state = ""
46+ }
47+ if (tooltip.state === "open") {
4548 quickList.state = ""
4649 }
4750 }
@@ -172,6 +175,12 @@ Rectangle {
172175 property real realContentY: contentY - originY + topMargin
173176 property int realItemHeight: itemHeight + spacing
174177
178+ onRealContentYChanged : {
179+ if (tooltip.state === "open") {
180+ tooltip.state = "";
181+ }
182+ }
183+
175184 // In case the start dragging transition is running, we need to delay the
176185 // move because the displaced transition would clash with it and cause items
177186 // to be moved to wrong places
@@ -399,6 +408,7 @@ Rectangle {
399408 id: dndArea
400409 objectName: "dndArea"
401410 acceptedButtons: Qt.LeftButton | Qt.RightButton
411+ hoverEnabled: true
402412 anchors {
403413 fill: parent
404414 topMargin: launcherListView.topMargin
@@ -421,12 +431,20 @@ Rectangle {
421431
422432 function processPress(mouse) {
423433 selectedItem = launcherListView.itemAt(mouse.x, mouse.y + launcherListView.realContentY)
434+
435+ if (tooltip.state === "open") {
436+ tooltip.state = "";
437+ }
424438 }
425439
426440 onClicked: {
427441 var index = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
428442 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
429443
444+ if (tooltip.state === "open") {
445+ tooltip.state = "";
446+ }
447+
430448 // Check if we actually clicked an item or only at the spacing in between
431449 if (clickedItem === null) {
432450 return;
@@ -434,8 +452,7 @@ Rectangle {
434452
435453 if (mouse.button & Qt.RightButton) { // context menu
436454 // Opening QuickList
437− //quickList.open(index);
438− tooltip.open(index);
455+ quickList.open(index);
439456 return;
440457 }
441458
@@ -527,6 +544,10 @@ Rectangle {
527544 startY = mouse.y
528545 }
529546
547+ onExited: {
548+ tooltip.state = "";
549+ }
550+
530551 onPositionChanged: {
531552 processPositionChanged(mouse)
532553 }
@@ -581,6 +602,17 @@ Rectangle {
581602 draggedIndex = newIndex
582603 }
583604 }
605+ } else {
606+ var index = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight);
607+ var clickedItem = launcherListView.itemAt(mouse.x, mouse.y + launcherListView.realContentY);
608+
609+ // Check if we actually hovered an item or only the spacing in between
610+ if (clickedItem === null || mouse.buttons) {
611+ tooltip.state = "";
612+ return;
613+ }
614+
615+ tooltip.open(index);
584616 }
585617 }
586618 }
@@ -635,7 +667,7 @@ Rectangle {
635667
636668 UbuntuShape {
637669 id: quickListShape
638− //objectName: "quickListShape"
670+ objectName: "quickListShape"
639671 anchors.fill: quickList
640672 opacity: quickList.state === "open" ? 0.95 : 0
641673 visible: opacity > 0
@@ -833,7 +865,7 @@ Rectangle {
833865 UbuntuShape {
834866 id: tooltipShape
835867 anchors.fill: tooltip
836− opacity: tooltip.state === "open" ? 0.95 : 0
868+ opacity: tooltip.state === "open" && quickList.state != "open" ? 0.95 : 0
837869 visible: opacity > 0
838870 rotation: root.rotation
839871 aspect: UbuntuShape.Flat
@@ -867,8 +899,8 @@ Rectangle {
867899 color: theme.palette.normal.background
868900 visible: tooltipShape.visible
869901
870− width: tooltipLabel.width
871− height: units.gu(5)
902+ width: tooltipLabel.contentWidth + units.gu(4)
903+ height: tooltipLabel.contentHeight + units.gu(2)
872904
873905 y: itemCenter - (height / 2) + offset
874906 rotation: root.rotation
@@ -885,30 +917,8 @@ Rectangle {
885917 property int itemCenter: item ? root.mapFromItem(tooltip.item, 0, 0).y + (item.height / 2) + tooltip.item.offset : units.gu(1)
886918 property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
887919 itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0
888− /*
889− // Because we're setting left/right anchors depending on orientation, it will break the
890− // width setting after rotating twice. This makes sure we also re-apply width on rotation
891− // width: root.inverted ? units.gu(30) : units.gu(30)
892− height: tooltipLabel.height
893− visible: tooltipShape.visible
894− anchors {
895− left: root.inverted ? undefined : parent.right
896− right: root.inverted ? parent.left : undefined
897− margins: units.gu(1)
898− }
899− y: itemCenter - (height / 2) + offset
900− rotation: root.rotation
901−
902− property string name
903− property var item
904−
905− // internal
906− property int itemCenter: item ? root.mapFromItem(tooltip.item, 0, 0).y + (item.height / 2) + tooltip.item.offset : units.gu(1)
907− property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
908− itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0*/
909920
910921 function open(index) {
911− console.log("ciao")
912922 var itemPosition = index * launcherListView.itemHeight;
913923 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
914924 item = launcherListView.itemAt(launcherListView.width / 2, itemPosition + launcherListView.itemHeight / 2);
@@ -918,16 +928,10 @@ Rectangle {
918928
919929 Label {
920930 id: tooltipLabel
921− //width: parent.width
922− //anchors.fill: parent
923− anchors.leftMargin: units.gu(2)
924− anchors.rightMargin: units.gu(2)
925− anchors.topMargin: units.gu(2)
926− anchors.bottomMargin: units.gu(2)
931+ height: parent.height
932+ anchors.centerIn: parent
927933 verticalAlignment: Label.AlignVCenter
928934 text: tooltip.text
929− fontSize: "medium"
930− font.weight: Font.Medium
931935 color: theme.palette.normal.backgroundText
932936 }
933937 }