2 * Copyright (C) 2013-2016 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18import QtQml.StateMachine 1.0 as DSM
19import Lomiri.Components 1.3
20import Lomiri.Launcher 0.1
21import Lomiri.Components.Popups 1.3
29 property bool lightMode : false
30 color: lightMode ? "#F2FEFEFE" : "#F2111111"
32 rotation: inverted ? 180 : 0
35 property bool inverted: false
36 property bool privateMode: false
37 property bool moving: launcherListView.moving || launcherListView.flicking
38 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
39 || dndArea.containsMouse || dashItem.hovered
40 property int highlightIndex: -2
41 property bool shortcutHintsShown: false
42 readonly property bool hasPeekingIcon: launcherListView.peekingIndex !== -1
43 readonly property bool quickListOpen: quickList.state === "open"
44 readonly property bool dragging: launcherListView.dragging || dndArea.dragging
46 signal applicationSelected(string appId)
48 signal kbdNavigationCancelled()
51 if (quickList.state === "open") {
56 function highlightNext() {
58 if (highlightIndex >= launcherListView.count) {
61 launcherListView.moveToIndex(Math.max(highlightIndex, 0));
63 function highlightPrevious() {
65 if (highlightIndex <= -2) {
66 highlightIndex = launcherListView.count - 1;
68 launcherListView.moveToIndex(Math.max(highlightIndex, 0));
70 function openQuicklist(index) {
71 quickList.open(index);
72 quickList.selectedIndex = 0;
73 quickList.focus = true;
79 acceptedButtons: Qt.AllButtons
80 onWheel: wheel.accepted = true;
91 objectName: "buttonShowDashHome"
95 // To exchange the default Lomiri home logo bgcolor by your distro's bgcolor, add a gsettings override:
97 // [com.lomiri.Shell.Launcher]
98 // home-button-background-color='<some-RGB-value-such-as-#123456>'
100 if (Functions.isValidColor(launcherSettings.homeButtonBackgroundColor)) {
101 return launcherSettings.homeButtonBackgroundColor;
103 if (launcherSettings.homeButtonBackgroundColor != '')
104 console.warn(`Invalid color name '${launcherSettings.homeButtonBackgroundColor}'`);
106 return LomiriColors.orange;
109 readonly property bool highlighted: root.highlightIndex == -1;
113 schema.id: "com.lomiri.Shell.Launcher"
117 objectName: "dashItem"
118 width: parent.width * .75
120 anchors.centerIn: parent
121 source: homeLogoResolver.resolvedImage
122 rotation: root.rotation
127 objectName: "homeLogoResolver"
129 readonly property url defaultLogo: "file://" + Constants.defaultLogo
132 // To exchange the default Lomiri home logo by your distro's logo, add a gsettings override:
134 // [com.lomiri.Shell.Launcher]
135 // logo-picture-uri='image://theme/start-here'
137 launcherSettings.logoPictureUri,
145 activeFocusOnPress: false
146 onClicked: root.showDashHome()
150 styleName: "FocusShape"
152 anchors.margins: units.gu(.5)
154 visible: bfb.highlighted
161 anchors.left: parent.left
162 anchors.right: parent.right
163 height: parent.height - dashItem.height - parent.spacing*2
166 id: launcherListViewItem
172 objectName: "launcherListView"
175 topMargin: -extensionSize + width * .15
176 bottomMargin: -extensionSize + width * .15
178 topMargin: extensionSize
179 bottomMargin: extensionSize
180 height: parent.height - dashItem.height - parent.spacing*2
182 cacheBuffer: itemHeight * 3
183 snapMode: interactive ? ListView.SnapToItem : ListView.NoSnap
184 highlightRangeMode: ListView.ApplyRange
185 preferredHighlightBegin: (height - itemHeight) / 2
186 preferredHighlightEnd: (height + itemHeight) / 2
188 // for the single peeking icon, when alert-state is set on delegate
189 property int peekingIndex: -1
191 // The size of the area the ListView is extended to make sure items are not
192 // destroyed when dragging them outside the list. This needs to be at least
193 // itemHeight to prevent folded items from disappearing and DragArea limits
194 // need to be smaller than this size to avoid breakage.
195 property int extensionSize: itemHeight * 3
197 // Workaround: The snap settings in the launcher, will always try to
198 // snap to what we told it to do. However, we want the initial position
199 // of the launcher to not be centered, but instead start with the topmost
200 // item unfolded completely. Lets wait for the ListView to settle after
201 // creation and then reposition it to 0.
202 // https://bugreports.qt-project.org/browse/QTBUG-32251
203 Component.onCompleted: {
210 launcherListView.moveToIndex(0)
214 // The height of the area where icons start getting folded
215 property int foldingStartHeight: itemHeight
216 // The height of the area where the items reach the final folding angle
217 property int foldingStopHeight: foldingStartHeight - itemHeight - spacing
218 property int itemWidth: width * .75
219 property int itemHeight: itemWidth * 15 / 16 + units.gu(1)
220 property int clickFlickSpeed: units.gu(60)
221 property int draggedIndex: dndArea.draggedIndex
222 property real realContentY: contentY - originY + topMargin
223 property int realItemHeight: itemHeight + spacing
225 // In case the start dragging transition is running, we need to delay the
226 // move because the displaced transition would clash with it and cause items
227 // to be moved to wrong places
228 property bool draggingTransitionRunning: false
229 property int scheduledMoveTo: -1
231 LomiriNumberAnimation {
232 id: snapToBottomAnimation
233 target: launcherListView
235 to: launcherListView.originY + launcherListView.topMargin
238 LomiriNumberAnimation {
239 id: snapToTopAnimation
240 target: launcherListView
242 to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY - launcherListView.topMargin
245 LomiriNumberAnimation {
247 objectName: "moveAnimation"
248 target: launcherListView
250 function moveTo(contentY) {
251 from = launcherListView.contentY;
256 function moveToIndex(index) {
257 var totalItemHeight = launcherListView.itemHeight + launcherListView.spacing
258 var itemPosition = index * totalItemHeight;
259 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
260 var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : totalItemHeight
261 if (itemPosition + totalItemHeight + distanceToEnd > launcherListView.contentY + launcherListView.originY + launcherListView.topMargin + height) {
262 moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd - launcherListView.originY);
263 } else if (itemPosition - distanceToEnd < launcherListView.contentY - launcherListView.originY + launcherListView.topMargin) {
264 moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin + launcherListView.originY);
268 displaced: Transition {
269 NumberAnimation { properties: "x,y"; duration: LomiriAnimation.FastDuration; easing: LomiriAnimation.StandardEasing }
272 delegate: FoldingLauncherDelegate {
274 objectName: "launcherDelegate" + index
275 // We need the appId in the delegate in order to find
276 // the right app when running autopilot tests for
278 readonly property string appId: model.appId
281 itemHeight: launcherListView.itemHeight
282 itemWidth: launcherListView.itemWidth
287 countVisible: model.countVisible
288 progress: model.progress
289 itemRunning: model.running
290 itemFocused: model.focused
291 inverted: root.inverted
292 alerting: model.alerting
293 highlighted: root.highlightIndex == index
294 shortcutHintShown: root.shortcutHintsShown && index <= 9
295 surfaceCount: model.surfaceCount
298 property bool dragging: false
300 SequentialAnimation {
302 objectName: "peekingAnimation" + index
305 PropertyAction { target: launcherListViewItem; property: "clip"; value: 0 }
307 LomiriNumberAnimation {
308 target: launcherDelegate
312 to: (units.gu(.5) + launcherListView.width * .5) * (root.inverted ? -1 : 1)
313 duration: LomiriAnimation.BriskDuration
317 LomiriNumberAnimation {
318 target: launcherDelegate
323 duration: LomiriAnimation.BriskDuration
326 PropertyAction { target: launcherListViewItem; property: "clip"; value: 1 }
327 PropertyAction { target: launcherListView; property: "peekingIndex"; value: -1 }
332 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
333 launcherListView.moveToIndex(index)
334 if (!dragging && launcher.state !== "visible" && launcher.state !== "drawer") {
335 peekingAnimation.start()
339 if (launcherListView.peekingIndex === -1) {
340 launcherListView.peekingIndex = index
343 if (launcherListView.peekingIndex === index) {
344 launcherListView.peekingIndex = -1
351 objectName: "dropIndicator"
352 anchors.centerIn: parent
353 height: visible ? units.dp(2) : 0
354 width: parent.width + mainColumn.anchors.leftMargin + mainColumn.anchors.rightMargin
356 source: "graphics/divider-line.png"
362 when: dndArea.selectedItem === launcherDelegate && fakeDragItem.visible && !dragging
364 target: launcherDelegate
372 target: launcherDelegate
377 target: dropIndicator
383 when: dndArea.draggedIndex >= 0 && (dndArea.preDragging || dndArea.dragging || dndArea.postDragging) && dndArea.draggedIndex != index
385 target: launcherDelegate
397 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.FastDuration }
402 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.FastDuration }
403 LomiriNumberAnimation { properties: "angle,offset" }
408 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.BriskDuration }
409 LomiriNumberAnimation { properties: "angle,offset" }
412 id: draggingTransition
415 SequentialAnimation {
416 PropertyAction { target: launcherListView; property: "draggingTransitionRunning"; value: true }
418 LomiriNumberAnimation { properties: "height" }
419 NumberAnimation { target: dropIndicator; properties: "opacity"; duration: LomiriAnimation.FastDuration }
423 if (launcherListView.scheduledMoveTo > -1) {
424 launcherListView.model.move(dndArea.draggedIndex, launcherListView.scheduledMoveTo)
425 dndArea.draggedIndex = launcherListView.scheduledMoveTo
426 launcherListView.scheduledMoveTo = -1
430 PropertyAction { target: launcherListView; property: "draggingTransitionRunning"; value: false }
436 NumberAnimation { target: dropIndicator; properties: "opacity"; duration: LomiriAnimation.SnapDuration }
437 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.BriskDuration }
438 SequentialAnimation {
439 ScriptAction { script: if (index == launcherListView.count-1) launcherListView.flick(0, -launcherListView.clickFlickSpeed); }
440 LomiriNumberAnimation { properties: "height" }
441 ScriptAction { script: if (index == launcherListView.count-1) launcherListView.flick(0, -launcherListView.clickFlickSpeed); }
442 PropertyAction { target: dndArea; property: "postDragging"; value: false }
443 PropertyAction { target: dndArea; property: "draggedIndex"; value: -1 }
451 objectName: "dndArea"
452 acceptedButtons: Qt.LeftButton | Qt.RightButton
456 topMargin: launcherListView.topMargin
457 bottomMargin: launcherListView.bottomMargin
459 drag.minimumY: -launcherListView.topMargin
460 drag.maximumY: height + launcherListView.bottomMargin
462 property int draggedIndex: -1
463 property var selectedItem
464 property bool preDragging: false
465 property bool dragging: !!selectedItem && selectedItem.dragging
466 property bool postDragging: false
470 // This is a workaround for some issue in the QML ListView:
471 // When calling moveToItem(0), the listview visually positions itself
472 // correctly to display the first item expanded. However, some internal
473 // state seems to not be valid, and the next time the user clicks on it,
474 // it snaps back to the snap boundries before executing the onClicked handler.
475 // This can cause the listview getting stuck in a snapped position where you can't
476 // launch things without first dragging the launcher manually. So lets read the item
477 // angle before that happens and use that angle instead of the one we get in onClicked.
478 property real pressedStartAngle: 0
480 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
481 pressedStartAngle = clickedItem.angle;
485 function processPress(mouse) {
486 selectedItem = launcherListView.itemAt(mouse.x, mouse.y + launcherListView.realContentY)
490 var index = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
491 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
493 // Check if we actually clicked an item or only at the spacing in between
494 if (clickedItem === null) {
498 if (mouse.button & Qt.RightButton) { // context menu
500 quickList.open(index);
506 // First/last item do the scrolling at more than 12 degrees
507 if (index == 0 || index == launcherListView.count - 1) {
508 launcherListView.moveToIndex(index);
509 if (pressedStartAngle <= 12 && pressedStartAngle >= -12) {
510 root.applicationSelected(LauncherModel.get(index).appId);
515 // the rest launches apps up to an angle of 30 degrees
516 if (clickedItem.angle > 30 || clickedItem.angle < -30) {
517 launcherListView.moveToIndex(index);
519 root.applicationSelected(LauncherModel.get(index).appId);
531 function endDrag(dragItem) {
532 var droppedIndex = draggedIndex;
543 selectedItem.dragging = false;
544 selectedItem = undefined;
547 dragItem.target = undefined
549 progressiveScrollingTimer.stop();
550 launcherListView.interactive = true;
551 if (droppedIndex >= launcherListView.count - 2 && postDragging) {
552 snapToBottomAnimation.start();
553 } else if (droppedIndex < 2 && postDragging) {
554 snapToTopAnimation.start();
559 processPressAndHold(mouse, drag);
562 function processPressAndHold(mouse, dragItem) {
563 if (Math.abs(selectedItem.angle) > 30) {
569 draggedIndex = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight);
571 quickList.open(draggedIndex)
573 launcherListView.interactive = false
575 var yOffset = draggedIndex > 0 ? (mouse.y + launcherListView.realContentY) % (draggedIndex * launcherListView.realItemHeight) : mouse.y + launcherListView.realContentY
577 fakeDragItem.iconName = launcherListView.model.get(draggedIndex).icon
578 fakeDragItem.x = units.gu(0.5)
579 fakeDragItem.y = mouse.y - yOffset + launcherListView.anchors.topMargin + launcherListView.topMargin
580 fakeDragItem.angle = selectedItem.angle * (root.inverted ? -1 : 1)
581 fakeDragItem.offset = selectedItem.offset * (root.inverted ? -1 : 1)
582 fakeDragItem.count = LauncherModel.get(draggedIndex).count
583 fakeDragItem.progress = LauncherModel.get(draggedIndex).progress
584 fakeDragItem.flatten()
585 dragItem.target = fakeDragItem
592 processPositionChanged(mouse)
595 function processPositionChanged(mouse) {
596 if (draggedIndex >= 0) {
597 if (selectedItem && !selectedItem.dragging) {
598 var distance = Math.max(Math.abs(mouse.x - startX), Math.abs(mouse.y - startY))
599 if (!preDragging && distance > units.gu(1.5)) {
601 quickList.state = "";
603 if (distance > launcherListView.itemHeight) {
604 selectedItem.dragging = true
610 var itemCenterY = fakeDragItem.y + fakeDragItem.height / 2
612 // Move it down by the the missing size to compensate index calculation with only expanded items
613 itemCenterY += (launcherListView.itemHeight - selectedItem.height) / 2
615 if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - launcherListView.realItemHeight) {
616 progressiveScrollingTimer.downwards = false
617 progressiveScrollingTimer.start()
618 } else if (mouseY < launcherListView.realItemHeight) {
619 progressiveScrollingTimer.downwards = true
620 progressiveScrollingTimer.start()
622 progressiveScrollingTimer.stop()
625 var newIndex = (itemCenterY + launcherListView.realContentY) / launcherListView.realItemHeight
627 if (newIndex > draggedIndex + 1) {
628 newIndex = draggedIndex + 1
629 } else if (newIndex < draggedIndex) {
630 newIndex = draggedIndex -1
635 if (newIndex >= 0 && newIndex < launcherListView.count) {
636 if (launcherListView.draggingTransitionRunning) {
637 launcherListView.scheduledMoveTo = newIndex
639 launcherListView.model.move(draggedIndex, newIndex)
640 draggedIndex = newIndex
647 id: progressiveScrollingTimer
651 property bool downwards: true
654 var minY = -launcherListView.topMargin
655 if (launcherListView.contentY > minY) {
656 launcherListView.contentY = Math.max(launcherListView.contentY - units.dp(2), minY)
659 var maxY = launcherListView.contentHeight - launcherListView.height + launcherListView.topMargin + launcherListView.originY
660 if (launcherListView.contentY < maxY) {
661 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
671 objectName: "fakeDragItem"
672 visible: dndArea.draggedIndex >= 0 && !dndArea.postDragging
673 itemWidth: launcherListView.itemWidth
674 itemHeight: launcherListView.itemHeight
677 rotation: root.rotation
679 onVisibleChanged: if (!visible) iconName = "";
682 fakeDragItemAnimation.start();
685 LomiriNumberAnimation {
686 id: fakeDragItemAnimation
687 target: fakeDragItem;
688 properties: "angle,offset";
697 objectName: "quickListShape"
698 anchors.fill: quickList
699 opacity: quickList.state === "open" ? 0.95 : 0
701 rotation: root.rotation
702 aspect: LomiriShape.Flat
704 // Denotes that the shape is not animating, to prevent race conditions during testing
705 readonly property bool ready: (visible && (!quickListShapeOpacityFade.running))
707 Behavior on opacity {
708 LomiriNumberAnimation {
709 id: quickListShapeOpacityFade
713 source: ShaderEffectSource {
714 sourceItem: quickList
721 rightMargin: -units.dp(4)
722 verticalCenter: parent.verticalCenter
723 verticalCenterOffset: -quickList.offset * (root.inverted ? -1 : 1)
727 source: "graphics/quicklist_tooltip.png"
733 anchors.fill: quickListShape
734 enabled: quickList.state == "open" || pressed
735 hoverEnabled: enabled
739 quickList.state = "";
740 quickList.focus = false;
741 root.kbdNavigationCancelled();
744 // Forward for dragging to work when quickList is open
747 var m = mapToItem(dndArea, mouseX, mouseY)
748 dndArea.processPress(m)
752 var m = mapToItem(dndArea, mouseX, mouseY)
753 dndArea.processPressAndHold(m, drag)
757 var m = mapToItem(dndArea, mouseX, mouseY)
758 dndArea.processPositionChanged(m)
762 dndArea.endDrag(drag);
766 dndArea.endDrag(drag);
772 objectName: "quickList"
773 color: theme.palette.normal.background
774 // Because we're setting left/right anchors depending on orientation, it will break the
775 // width setting after rotating twice. This makes sure we also re-apply width on rotation
776 width: root.inverted ? units.gu(30) : units.gu(30)
777 height: quickListColumn.height
778 visible: quickListShape.visible
780 left: root.inverted ? undefined : parent.right
781 right: root.inverted ? parent.left : undefined
784 y: itemCenter - (height / 2) + offset
785 rotation: root.rotation
788 property string appId
790 property int selectedIndex: -1
795 var prevIndex = selectedIndex;
796 selectedIndex = (selectedIndex + 1 < popoverRepeater.count) ? selectedIndex + 1 : 0;
797 while (!popoverRepeater.itemAt(selectedIndex).clickable && selectedIndex != prevIndex) {
798 selectedIndex = (selectedIndex + 1 < popoverRepeater.count) ? selectedIndex + 1 : 0;
800 event.accepted = true;
803 var prevIndex = selectedIndex;
804 selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : popoverRepeater.count - 1;
805 while (!popoverRepeater.itemAt(selectedIndex).clickable && selectedIndex != prevIndex) {
806 selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : popoverRepeater.count - 1;
808 event.accepted = true;
812 quickList.selectedIndex = -1;
813 quickList.focus = false;
815 event.accepted = true;
820 if (quickList.selectedIndex >= 0) {
821 LauncherModel.quickListActionInvoked(quickList.appId, quickList.selectedIndex)
823 quickList.selectedIndex = -1;
824 quickList.focus = false;
826 root.kbdNavigationCancelled();
827 event.accepted = true;
833 property int itemCenter: item ? root.mapFromItem(quickList.item, 0, 0).y + (item.height / 2) + quickList.item.offset : units.gu(1)
834 property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
835 itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0
837 function open(index) {
838 var itemPosition = index * launcherListView.itemHeight;
839 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
840 item = launcherListView.itemAt(launcherListView.width / 2, itemPosition + launcherListView.itemHeight / 2);
841 quickList.model = launcherListView.model.get(index).quickList;
842 quickList.appId = launcherListView.model.get(index).appId;
843 quickList.state = "open";
844 root.highlightIndex = index;
845 quickList.forceActiveFocus();
850 height: quickListColumn.height
856 var item = quickListColumn.childAt(mouseX, mouseY);
857 if (item.clickable) {
858 quickList.selectedIndex = item.index;
860 quickList.selectedIndex = -1;
868 height: childrenRect.height
872 objectName: "popoverRepeater"
873 model: QuickListProxyModel {
874 source: quickList.model ? quickList.model : null
875 privateMode: root.privateMode
879 readonly property bool clickable: model.clickable
880 readonly property int index: model.index
882 objectName: "quickListEntry" + index
883 selected: index === quickList.selectedIndex
884 height: label.implicitHeight + label.anchors.topMargin + label.anchors.bottomMargin
885 color: model.clickable ? (selected ? theme.palette.highlighted.background : "transparent") : theme.palette.disabled.background
886 highlightColor: !model.clickable ? quickList.color : undefined // make disabled items visually unclickable
887 divider.colorFrom: LomiriColors.inkstone
888 divider.colorTo: LomiriColors.inkstone
889 divider.visible: model.hasSeparator
894 anchors.leftMargin: units.gu(3) // 2 GU for checkmark, 3 GU total
895 anchors.rightMargin: units.gu(2)
896 anchors.topMargin: units.gu(2)
897 anchors.bottomMargin: units.gu(2)
898 verticalAlignment: Label.AlignVCenter
900 fontSize: index == 0 ? "medium" : "small"
901 font.weight: index == 0 ? Font.Medium : Font.Light
902 color: model.clickable ? theme.palette.normal.backgroundText : theme.palette.disabled.backgroundText
903 elide: Text.ElideRight
907 if (!model.clickable) {
911 quickList.state = "";
912 // Unsetting model to prevent showing changing entries during fading out
913 // that may happen because of triggering an action.
914 LauncherModel.quickListActionInvoked(quickList.appId, index);
915 quickList.focus = false;
916 root.kbdNavigationCancelled();
917 quickList.model = undefined;
927 objectName: "tooltipShape"
929 visible: tooltipShownState.active
930 rotation: root.rotation
931 y: itemCenter - (height / 2)
934 left: root.inverted ? undefined : parent.right
935 right: root.inverted ? parent.left : undefined
939 readonly property var hoveredItem: dndArea.containsMouse ? launcherListView.itemAt(dndArea.mouseX, dndArea.mouseY + launcherListView.realContentY) : null
940 readonly property int itemCenter: !hoveredItem ? 0 : root.mapFromItem(hoveredItem, 0, 0).y + (hoveredItem.height / 2) + hoveredItem.offset
942 text: !hoveredItem ? "" : hoveredItem.name
946 id: tooltipStateMachine
947 initialState: tooltipHiddenState
951 id: tooltipHiddenState
953 DSM.SignalTransition {
954 targetState: tooltipShownState
955 signal: tooltipShape.hoveredItemChanged
956 // !dndArea.pressed allows us to filter out touch input events
957 guard: tooltipShape.hoveredItem !== null && !dndArea.pressed && !root.moving
962 id: tooltipShownState
964 DSM.SignalTransition {
965 targetState: tooltipHiddenState
966 signal: tooltipShape.hoveredItemChanged
967 guard: tooltipShape.hoveredItem === null
970 DSM.SignalTransition {
971 targetState: tooltipDismissedState
972 signal: dndArea.onPressed
975 DSM.SignalTransition {
976 targetState: tooltipDismissedState
977 signal: quickList.stateChanged
978 guard: quickList.state === "open"
983 id: tooltipDismissedState
985 DSM.SignalTransition {
986 targetState: tooltipHiddenState
987 signal: dndArea.positionChanged
988 guard: quickList.state != "open" && !dndArea.pressed && !dndArea.moving
991 DSM.SignalTransition {
992 targetState: tooltipHiddenState
993 signal: dndArea.exited
994 guard: quickList.state != "open"