@@ -41,7 +41,10 @@ Rectangle {
41 signal kbdNavigationCancelled()
41 signal kbdNavigationCancelled()
43 onXChanged: {
43 onXChanged: {
44− if (quickList.state == "open") {
44+ if (quickList.state === "open") {
47+ if (tooltip.state === "open") {
45 quickList.state = ""
48 quickList.state = ""
@@ -172,6 +175,12 @@ Rectangle {
172 property real realContentY: contentY - originY + topMargin
175 property real realContentY: contentY - originY + topMargin
173 property int realItemHeight: itemHeight + spacing
176 property int realItemHeight: itemHeight + spacing
178+ onRealContentYChanged : {
179+ if (tooltip.state === "open") {
175 // In case the start dragging transition is running, we need to delay the
184 // In case the start dragging transition is running, we need to delay the
176 // move because the displaced transition would clash with it and cause items
185 // move because the displaced transition would clash with it and cause items
177 // to be moved to wrong places
186 // to be moved to wrong places
@@ -399,6 +408,7 @@ Rectangle {
399 id: dndArea
408 id: dndArea
400 objectName: "dndArea"
409 objectName: "dndArea"
401 acceptedButtons: Qt.LeftButton | Qt.RightButton
410 acceptedButtons: Qt.LeftButton | Qt.RightButton
402 anchors {
412 anchors {
403 fill: parent
413 fill: parent
404 topMargin: launcherListView.topMargin
414 topMargin: launcherListView.topMargin
@@ -421,12 +431,20 @@ Rectangle {
422 function processPress(mouse) {
432 function processPress(mouse) {
423 selectedItem = launcherListView.itemAt(mouse.x, mouse.y + launcherListView.realContentY)
433 selectedItem = launcherListView.itemAt(mouse.x, mouse.y + launcherListView.realContentY)
435+ if (tooltip.state === "open") {
426 onClicked: {
440 onClicked: {
427 var index = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
441 var index = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
428 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
442 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
444+ if (tooltip.state === "open") {
430 // Check if we actually clicked an item or only at the spacing in between
448 // Check if we actually clicked an item or only at the spacing in between
431 if (clickedItem === null) {
449 if (clickedItem === null) {
@@ -434,8 +452,7 @@ Rectangle {
435 if (mouse.button & Qt.RightButton) { // context menu
453 if (mouse.button & Qt.RightButton) { // context menu
436 // Opening QuickList
454 // Opening QuickList
437− //quickList.open(index);
438− tooltip.open(index);
455+ quickList.open(index);
@@ -527,6 +544,10 @@ Rectangle {
527 startY = mouse.y
544 startY = mouse.y
530 onPositionChanged: {
551 onPositionChanged: {
531 processPositionChanged(mouse)
552 processPositionChanged(mouse)
@@ -581,6 +602,17 @@ Rectangle {
581 draggedIndex = newIndex
602 draggedIndex = newIndex
606+ var index = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight);
607+ var clickedItem = launcherListView.itemAt(mouse.x, mouse.y + launcherListView.realContentY);
609+ // Check if we actually hovered an item or only the spacing in between
610+ if (clickedItem === null || mouse.buttons) {
615+ tooltip.open(index);
@@ -635,7 +667,7 @@ Rectangle {
636 UbuntuShape {
668 UbuntuShape {
637 id: quickListShape
669 id: quickListShape
638− //objectName: "quickListShape"
670+ objectName: "quickListShape"
639 anchors.fill: quickList
671 anchors.fill: quickList
640 opacity: quickList.state === "open" ? 0.95 : 0
672 opacity: quickList.state === "open" ? 0.95 : 0
641 visible: opacity > 0
673 visible: opacity > 0
@@ -833,7 +865,7 @@ Rectangle {
833 UbuntuShape {
865 UbuntuShape {
834 id: tooltipShape
866 id: tooltipShape
835 anchors.fill: tooltip
867 anchors.fill: tooltip
836− opacity: tooltip.state === "open" ? 0.95 : 0
868+ opacity: tooltip.state === "open" && quickList.state != "open" ? 0.95 : 0
837 visible: opacity > 0
869 visible: opacity > 0
838 rotation: root.rotation
870 rotation: root.rotation
839 aspect: UbuntuShape.Flat
871 aspect: UbuntuShape.Flat
@@ -867,8 +899,8 @@ Rectangle {
867 color: theme.palette.normal.background
899 color: theme.palette.normal.background
868 visible: tooltipShape.visible
900 visible: tooltipShape.visible
870− width: tooltipLabel.width
902+ width: tooltipLabel.contentWidth + units.gu(4)
871− height: units.gu(5)
903+ height: tooltipLabel.contentHeight + units.gu(2)
873 y: itemCenter - (height / 2) + offset
905 y: itemCenter - (height / 2) + offset
874 rotation: root.rotation
906 rotation: root.rotation
@@ -885,30 +917,8 @@ Rectangle {
885 property int itemCenter: item ? root.mapFromItem(tooltip.item, 0, 0).y + (item.height / 2) + tooltip.item.offset : units.gu(1)
917 property int itemCenter: item ? root.mapFromItem(tooltip.item, 0, 0).y + (item.height / 2) + tooltip.item.offset : units.gu(1)
886 property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
918 property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
887 itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0
919 itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0
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
895− left: root.inverted ? undefined : parent.right
896− right: root.inverted ? parent.left : undefined
897− margins: units.gu(1)
899− y: itemCenter - (height / 2) + offset
900− rotation: root.rotation
902− property string name
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*/
910 function open(index) {
921 function open(index) {
912 var itemPosition = index * launcherListView.itemHeight;
922 var itemPosition = index * launcherListView.itemHeight;
913 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
923 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
914 item = launcherListView.itemAt(launcherListView.width / 2, itemPosition + launcherListView.itemHeight / 2);
924 item = launcherListView.itemAt(launcherListView.width / 2, itemPosition + launcherListView.itemHeight / 2);
@@ -918,16 +928,10 @@ Rectangle {
920 id: tooltipLabel
930 id: tooltipLabel
921− //width: parent.width
931+ height: parent.height
922− //anchors.fill: parent
932+ anchors.centerIn: 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)
927 verticalAlignment: Label.AlignVCenter
933 verticalAlignment: Label.AlignVCenter
928 text: tooltip.text
934 text: tooltip.text
930− font.weight: Font.Medium
931 color: theme.palette.normal.backgroundText
935 color: theme.palette.normal.backgroundText