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 color: theme.palette.normal.background.hslLightness >= 0.5 ? "#F2FEFEFE" : "#F2111111"
31 rotation: inverted ? 180 : 0
34 property bool inverted: false
35 property bool privateMode: false
36 property bool moving: launcherListView.moving || launcherListView.flicking
37 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
38 || dndArea.containsMouse || dashItem.hovered
39 property int highlightIndex: -2
40 property bool shortcutHintsShown: false
41 readonly property bool hasPeekingIcon: launcherListView.peekingIndex !== -1
42 readonly property bool quickListOpen: quickList.state === "open"
43 readonly property bool dragging: launcherListView.dragging || dndArea.dragging
45 signal applicationSelected(string appId)
47 signal kbdNavigationCancelled()
50 if (quickList.state === "open") {
55 function highlightNext() {
57 if (highlightIndex >= launcherListView.count) {
60 launcherListView.moveToIndex(Math.max(highlightIndex, 0));
62 function highlightPrevious() {
64 if (highlightIndex <= -2) {
65 highlightIndex = launcherListView.count - 1;
67 launcherListView.moveToIndex(Math.max(highlightIndex, 0));
69 function openQuicklist(index) {
70 quickList.open(index);
71 quickList.selectedIndex = 0;
72 quickList.focus = true;
78 acceptedButtons: Qt.AllButtons
79 onWheel: wheel.accepted = true;
90 objectName: "buttonShowDashHome"
94 // To exchange the default Lomiri home logo bgcolor by your distro's bgcolor, add a gsettings override:
96 // [com.lomiri.Shell.Launcher]
97 // home-button-background-color='<some-RGB-value-such-as-#123456>'
99 if (Functions.isValidColor(launcherSettings.homeButtonBackgroundColor)) {
100 return launcherSettings.homeButtonBackgroundColor;
102 if (launcherSettings.homeButtonBackgroundColor != '')
103 console.warn(`Invalid color name '${launcherSettings.homeButtonBackgroundColor}'`);
105 return LomiriColors.orange;
108 readonly property bool highlighted: root.highlightIndex == -1;
112 schema.id: "com.lomiri.Shell.Launcher"
116 objectName: "dashItem"
117 width: parent.width * .75
119 anchors.centerIn: parent
120 source: homeLogoResolver.resolvedImage
121 rotation: root.rotation
126 objectName: "homeLogoResolver"
128 readonly property url defaultLogo: "file://" + Constants.defaultLogo
131 // To exchange the default Lomiri home logo by your distro's logo, add a gsettings override:
133 // [com.lomiri.Shell.Launcher]
134 // logo-picture-uri='image://theme/start-here'
136 launcherSettings.logoPictureUri,
144 activeFocusOnPress: false
145 onClicked: root.showDashHome()
149 styleName: "FocusShape"
151 anchors.margins: units.gu(.5)
153 visible: bfb.highlighted
160 anchors.left: parent.left
161 anchors.right: parent.right
162 height: parent.height - dashItem.height - parent.spacing*2
165 id: launcherListViewItem
171 objectName: "launcherListView"
174 topMargin: -extensionSize + width * .15
175 bottomMargin: -extensionSize + width * .15
177 topMargin: extensionSize
178 bottomMargin: extensionSize
179 height: parent.height - dashItem.height - parent.spacing*2
181 cacheBuffer: itemHeight * 3
182 snapMode: interactive ? ListView.SnapToItem : ListView.NoSnap
183 highlightRangeMode: ListView.ApplyRange
184 preferredHighlightBegin: (height - itemHeight) / 2
185 preferredHighlightEnd: (height + itemHeight) / 2
187 // for the single peeking icon, when alert-state is set on delegate
188 property int peekingIndex: -1
190 // The size of the area the ListView is extended to make sure items are not
191 // destroyed when dragging them outside the list. This needs to be at least
192 // itemHeight to prevent folded items from disappearing and DragArea limits
193 // need to be smaller than this size to avoid breakage.
194 property int extensionSize: itemHeight * 3
196 // Workaround: The snap settings in the launcher, will always try to
197 // snap to what we told it to do. However, we want the initial position
198 // of the launcher to not be centered, but instead start with the topmost
199 // item unfolded completely. Lets wait for the ListView to settle after
200 // creation and then reposition it to 0.
201 // https://bugreports.qt-project.org/browse/QTBUG-32251
202 Component.onCompleted: {
209 launcherListView.moveToIndex(0)
213 // The height of the area where icons start getting folded
214 property int foldingStartHeight: itemHeight
215 // The height of the area where the items reach the final folding angle
216 property int foldingStopHeight: foldingStartHeight - itemHeight - spacing
217 property int itemWidth: width * .75
218 property int itemHeight: itemWidth * 15 / 16 + units.gu(1)
219 property int clickFlickSpeed: units.gu(60)
220 property int draggedIndex: dndArea.draggedIndex
221 property real realContentY: contentY - originY + topMargin
222 property int realItemHeight: itemHeight + spacing
224 // In case the start dragging transition is running, we need to delay the
225 // move because the displaced transition would clash with it and cause items
226 // to be moved to wrong places
227 property bool draggingTransitionRunning: false
228 property int scheduledMoveTo: -1
230 LomiriNumberAnimation {
231 id: snapToBottomAnimation
232 target: launcherListView
234 to: launcherListView.originY + launcherListView.topMargin
237 LomiriNumberAnimation {
238 id: snapToTopAnimation
239 target: launcherListView
241 to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY - launcherListView.topMargin
244 LomiriNumberAnimation {
246 objectName: "moveAnimation"
247 target: launcherListView
249 function moveTo(contentY) {
250 from = launcherListView.contentY;
255 function moveToIndex(index) {
256 var totalItemHeight = launcherListView.itemHeight + launcherListView.spacing
257 var itemPosition = index * totalItemHeight;
258 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
259 var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : totalItemHeight
260 if (itemPosition + totalItemHeight + distanceToEnd > launcherListView.contentY + launcherListView.originY + launcherListView.topMargin + height) {
261 moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd - launcherListView.originY);
262 } else if (itemPosition - distanceToEnd < launcherListView.contentY - launcherListView.originY + launcherListView.topMargin) {
263 moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin + launcherListView.originY);
267 displaced: Transition {
268 NumberAnimation { properties: "x,y"; duration: LomiriAnimation.FastDuration; easing: LomiriAnimation.StandardEasing }
271 delegate: FoldingLauncherDelegate {
273 objectName: "launcherDelegate" + index
274 // We need the appId in the delegate in order to find
275 // the right app when running autopilot tests for
277 readonly property string appId: model.appId
280 itemHeight: launcherListView.itemHeight
281 itemWidth: launcherListView.itemWidth
286 countVisible: model.countVisible
287 progress: model.progress
288 itemRunning: model.running
289 itemFocused: model.focused
290 inverted: root.inverted
291 alerting: model.alerting
292 highlighted: root.highlightIndex == index
293 shortcutHintShown: root.shortcutHintsShown && index <= 9
294 surfaceCount: model.surfaceCount
297 property bool dragging: false
299 SequentialAnimation {
301 objectName: "peekingAnimation" + index
304 PropertyAction { target: launcherListViewItem; property: "clip"; value: 0 }
306 LomiriNumberAnimation {
307 target: launcherDelegate
311 to: (units.gu(.5) + launcherListView.width * .5) * (root.inverted ? -1 : 1)
312 duration: LomiriAnimation.BriskDuration
316 LomiriNumberAnimation {
317 target: launcherDelegate
322 duration: LomiriAnimation.BriskDuration
325 PropertyAction { target: launcherListViewItem; property: "clip"; value: 1 }
326 PropertyAction { target: launcherListView; property: "peekingIndex"; value: -1 }
331 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
332 launcherListView.moveToIndex(index)
333 if (!dragging && launcher.state !== "visible" && launcher.state !== "drawer") {
334 peekingAnimation.start()
338 if (launcherListView.peekingIndex === -1) {
339 launcherListView.peekingIndex = index
342 if (launcherListView.peekingIndex === index) {
343 launcherListView.peekingIndex = -1
350 objectName: "dropIndicator"
351 anchors.centerIn: parent
352 height: visible ? units.dp(2) : 0
353 width: parent.width + mainColumn.anchors.leftMargin + mainColumn.anchors.rightMargin
355 source: "graphics/divider-line.png"
361 when: dndArea.selectedItem === launcherDelegate && fakeDragItem.visible && !dragging
363 target: launcherDelegate
371 target: launcherDelegate
376 target: dropIndicator
382 when: dndArea.draggedIndex >= 0 && (dndArea.preDragging || dndArea.dragging || dndArea.postDragging) && dndArea.draggedIndex != index
384 target: launcherDelegate
396 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.FastDuration }
401 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.FastDuration }
402 LomiriNumberAnimation { properties: "angle,offset" }
407 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.BriskDuration }
408 LomiriNumberAnimation { properties: "angle,offset" }
411 id: draggingTransition
414 SequentialAnimation {
415 PropertyAction { target: launcherListView; property: "draggingTransitionRunning"; value: true }
417 LomiriNumberAnimation { properties: "height" }
418 NumberAnimation { target: dropIndicator; properties: "opacity"; duration: LomiriAnimation.FastDuration }
422 if (launcherListView.scheduledMoveTo > -1) {
423 launcherListView.model.move(dndArea.draggedIndex, launcherListView.scheduledMoveTo)
424 dndArea.draggedIndex = launcherListView.scheduledMoveTo
425 launcherListView.scheduledMoveTo = -1
429 PropertyAction { target: launcherListView; property: "draggingTransitionRunning"; value: false }
435 NumberAnimation { target: dropIndicator; properties: "opacity"; duration: LomiriAnimation.SnapDuration }
436 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.BriskDuration }
437 SequentialAnimation {
438 ScriptAction { script: if (index == launcherListView.count-1) launcherListView.flick(0, -launcherListView.clickFlickSpeed); }
439 LomiriNumberAnimation { properties: "height" }
440 ScriptAction { script: if (index == launcherListView.count-1) launcherListView.flick(0, -launcherListView.clickFlickSpeed); }
441 PropertyAction { target: dndArea; property: "postDragging"; value: false }
442 PropertyAction { target: dndArea; property: "draggedIndex"; value: -1 }
450 objectName: "dndArea"
451 acceptedButtons: Qt.LeftButton | Qt.RightButton
455 topMargin: launcherListView.topMargin
456 bottomMargin: launcherListView.bottomMargin
458 drag.minimumY: -launcherListView.topMargin
459 drag.maximumY: height + launcherListView.bottomMargin
461 property int draggedIndex: -1
462 property var selectedItem
463 property bool preDragging: false
464 property bool dragging: !!selectedItem && selectedItem.dragging
465 property bool postDragging: false
469 // This is a workaround for some issue in the QML ListView:
470 // When calling moveToItem(0), the listview visually positions itself
471 // correctly to display the first item expanded. However, some internal
472 // state seems to not be valid, and the next time the user clicks on it,
473 // it snaps back to the snap boundries before executing the onClicked handler.
474 // This can cause the listview getting stuck in a snapped position where you can't
475 // launch things without first dragging the launcher manually. So lets read the item
476 // angle before that happens and use that angle instead of the one we get in onClicked.
477 property real pressedStartAngle: 0
479 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
480 pressedStartAngle = clickedItem.angle;
484 function processPress(mouse) {
485 selectedItem = launcherListView.itemAt(mouse.x, mouse.y + launcherListView.realContentY)
489 var index = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
490 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
492 // Check if we actually clicked an item or only at the spacing in between
493 if (clickedItem === null) {
497 if (mouse.button & Qt.RightButton) { // context menu
499 quickList.open(index);
505 // First/last item do the scrolling at more than 12 degrees
506 if (index == 0 || index == launcherListView.count - 1) {
507 launcherListView.moveToIndex(index);
508 if (pressedStartAngle <= 12 && pressedStartAngle >= -12) {
509 root.applicationSelected(LauncherModel.get(index).appId);
514 // the rest launches apps up to an angle of 30 degrees
515 if (clickedItem.angle > 30 || clickedItem.angle < -30) {
516 launcherListView.moveToIndex(index);
518 root.applicationSelected(LauncherModel.get(index).appId);
530 function endDrag(dragItem) {
531 var droppedIndex = draggedIndex;
542 selectedItem.dragging = false;
543 selectedItem = undefined;
546 dragItem.target = undefined
548 progressiveScrollingTimer.stop();
549 launcherListView.interactive = true;
550 if (droppedIndex >= launcherListView.count - 2 && postDragging) {
551 snapToBottomAnimation.start();
552 } else if (droppedIndex < 2 && postDragging) {
553 snapToTopAnimation.start();
558 processPressAndHold(mouse, drag);
561 function processPressAndHold(mouse, dragItem) {
562 if (Math.abs(selectedItem.angle) > 30) {
568 draggedIndex = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight);
570 quickList.open(draggedIndex)
572 launcherListView.interactive = false
574 var yOffset = draggedIndex > 0 ? (mouse.y + launcherListView.realContentY) % (draggedIndex * launcherListView.realItemHeight) : mouse.y + launcherListView.realContentY
576 fakeDragItem.iconName = launcherListView.model.get(draggedIndex).icon
577 fakeDragItem.x = units.gu(0.5)
578 fakeDragItem.y = mouse.y - yOffset + launcherListView.anchors.topMargin + launcherListView.topMargin
579 fakeDragItem.angle = selectedItem.angle * (root.inverted ? -1 : 1)
580 fakeDragItem.offset = selectedItem.offset * (root.inverted ? -1 : 1)
581 fakeDragItem.count = LauncherModel.get(draggedIndex).count
582 fakeDragItem.progress = LauncherModel.get(draggedIndex).progress
583 fakeDragItem.flatten()
584 dragItem.target = fakeDragItem
591 processPositionChanged(mouse)
594 function processPositionChanged(mouse) {
595 if (draggedIndex >= 0) {
596 if (selectedItem && !selectedItem.dragging) {
597 var distance = Math.max(Math.abs(mouse.x - startX), Math.abs(mouse.y - startY))
598 if (!preDragging && distance > units.gu(1.5)) {
600 quickList.state = "";
602 if (distance > launcherListView.itemHeight) {
603 selectedItem.dragging = true
609 var itemCenterY = fakeDragItem.y + fakeDragItem.height / 2
611 // Move it down by the the missing size to compensate index calculation with only expanded items
612 itemCenterY += (launcherListView.itemHeight - selectedItem.height) / 2
614 if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - launcherListView.realItemHeight) {
615 progressiveScrollingTimer.downwards = false
616 progressiveScrollingTimer.start()
617 } else if (mouseY < launcherListView.realItemHeight) {
618 progressiveScrollingTimer.downwards = true
619 progressiveScrollingTimer.start()
621 progressiveScrollingTimer.stop()
624 var newIndex = (itemCenterY + launcherListView.realContentY) / launcherListView.realItemHeight
626 if (newIndex > draggedIndex + 1) {
627 newIndex = draggedIndex + 1
628 } else if (newIndex < draggedIndex) {
629 newIndex = draggedIndex -1
634 if (newIndex >= 0 && newIndex < launcherListView.count) {
635 if (launcherListView.draggingTransitionRunning) {
636 launcherListView.scheduledMoveTo = newIndex
638 launcherListView.model.move(draggedIndex, newIndex)
639 draggedIndex = newIndex
646 id: progressiveScrollingTimer
650 property bool downwards: true
653 var minY = -launcherListView.topMargin
654 if (launcherListView.contentY > minY) {
655 launcherListView.contentY = Math.max(launcherListView.contentY - units.dp(2), minY)
658 var maxY = launcherListView.contentHeight - launcherListView.height + launcherListView.topMargin + launcherListView.originY
659 if (launcherListView.contentY < maxY) {
660 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
670 objectName: "fakeDragItem"
671 visible: dndArea.draggedIndex >= 0 && !dndArea.postDragging
672 itemWidth: launcherListView.itemWidth
673 itemHeight: launcherListView.itemHeight
676 rotation: root.rotation
678 onVisibleChanged: if (!visible) iconName = "";
681 fakeDragItemAnimation.start();
684 LomiriNumberAnimation {
685 id: fakeDragItemAnimation
686 target: fakeDragItem;
687 properties: "angle,offset";
696 objectName: "quickListShape"
697 anchors.fill: quickList
698 opacity: quickList.state === "open" ? 0.95 : 0
700 rotation: root.rotation
701 aspect: LomiriShape.Flat
703 // Denotes that the shape is not animating, to prevent race conditions during testing
704 readonly property bool ready: (visible && (!quickListShapeOpacityFade.running))
706 Behavior on opacity {
707 LomiriNumberAnimation {
708 id: quickListShapeOpacityFade
712 source: ShaderEffectSource {
713 sourceItem: quickList
720 rightMargin: -units.dp(4)
721 verticalCenter: parent.verticalCenter
722 verticalCenterOffset: -quickList.offset * (root.inverted ? -1 : 1)
726 source: "graphics/quicklist_tooltip.png"
732 anchors.fill: quickListShape
733 enabled: quickList.state == "open" || pressed
734 hoverEnabled: enabled
738 quickList.state = "";
739 quickList.focus = false;
740 root.kbdNavigationCancelled();
743 // Forward for dragging to work when quickList is open
746 var m = mapToItem(dndArea, mouseX, mouseY)
747 dndArea.processPress(m)
751 var m = mapToItem(dndArea, mouseX, mouseY)
752 dndArea.processPressAndHold(m, drag)
756 var m = mapToItem(dndArea, mouseX, mouseY)
757 dndArea.processPositionChanged(m)
761 dndArea.endDrag(drag);
765 dndArea.endDrag(drag);
771 objectName: "quickList"
772 color: theme.palette.normal.background
773 // Because we're setting left/right anchors depending on orientation, it will break the
774 // width setting after rotating twice. This makes sure we also re-apply width on rotation
775 width: root.inverted ? units.gu(30) : units.gu(30)
776 height: quickListColumn.height
777 visible: quickListShape.visible
779 left: root.inverted ? undefined : parent.right
780 right: root.inverted ? parent.left : undefined
783 y: itemCenter - (height / 2) + offset
784 rotation: root.rotation
787 property string appId
789 property int selectedIndex: -1
794 var prevIndex = selectedIndex;
795 selectedIndex = (selectedIndex + 1 < popoverRepeater.count) ? selectedIndex + 1 : 0;
796 while (!popoverRepeater.itemAt(selectedIndex).clickable && selectedIndex != prevIndex) {
797 selectedIndex = (selectedIndex + 1 < popoverRepeater.count) ? selectedIndex + 1 : 0;
799 event.accepted = true;
802 var prevIndex = selectedIndex;
803 selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : popoverRepeater.count - 1;
804 while (!popoverRepeater.itemAt(selectedIndex).clickable && selectedIndex != prevIndex) {
805 selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : popoverRepeater.count - 1;
807 event.accepted = true;
811 quickList.selectedIndex = -1;
812 quickList.focus = false;
814 event.accepted = true;
819 if (quickList.selectedIndex >= 0) {
820 LauncherModel.quickListActionInvoked(quickList.appId, quickList.selectedIndex)
822 quickList.selectedIndex = -1;
823 quickList.focus = false;
825 root.kbdNavigationCancelled();
826 event.accepted = true;
832 property int itemCenter: item ? root.mapFromItem(quickList.item, 0, 0).y + (item.height / 2) + quickList.item.offset : units.gu(1)
833 property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
834 itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0
836 function open(index) {
837 var itemPosition = index * launcherListView.itemHeight;
838 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
839 item = launcherListView.itemAt(launcherListView.width / 2, itemPosition + launcherListView.itemHeight / 2);
840 quickList.model = launcherListView.model.get(index).quickList;
841 quickList.appId = launcherListView.model.get(index).appId;
842 quickList.state = "open";
843 root.highlightIndex = index;
844 quickList.forceActiveFocus();
849 height: quickListColumn.height
855 var item = quickListColumn.childAt(mouseX, mouseY);
856 if (item.clickable) {
857 quickList.selectedIndex = item.index;
859 quickList.selectedIndex = -1;
867 height: childrenRect.height
871 objectName: "popoverRepeater"
872 model: QuickListProxyModel {
873 source: quickList.model ? quickList.model : null
874 privateMode: root.privateMode
878 readonly property bool clickable: model.clickable
879 readonly property int index: model.index
881 objectName: "quickListEntry" + index
882 selected: index === quickList.selectedIndex
883 height: label.implicitHeight + label.anchors.topMargin + label.anchors.bottomMargin
884 color: model.clickable ? (selected ? theme.palette.highlighted.background : "transparent") : theme.palette.disabled.background
885 highlightColor: !model.clickable ? quickList.color : undefined // make disabled items visually unclickable
886 divider.colorFrom: LomiriColors.inkstone
887 divider.colorTo: LomiriColors.inkstone
888 divider.visible: model.hasSeparator
893 anchors.leftMargin: units.gu(3) // 2 GU for checkmark, 3 GU total
894 anchors.rightMargin: units.gu(2)
895 anchors.topMargin: units.gu(2)
896 anchors.bottomMargin: units.gu(2)
897 verticalAlignment: Label.AlignVCenter
899 fontSize: index == 0 ? "medium" : "small"
900 font.weight: index == 0 ? Font.Medium : Font.Light
901 color: model.clickable ? theme.palette.normal.backgroundText : theme.palette.disabled.backgroundText
902 elide: Text.ElideRight
906 if (!model.clickable) {
910 quickList.state = "";
911 // Unsetting model to prevent showing changing entries during fading out
912 // that may happen because of triggering an action.
913 LauncherModel.quickListActionInvoked(quickList.appId, index);
914 quickList.focus = false;
915 root.kbdNavigationCancelled();
916 quickList.model = undefined;
926 objectName: "tooltipShape"
928 visible: tooltipShownState.active
929 rotation: root.rotation
930 y: itemCenter - (height / 2)
933 left: root.inverted ? undefined : parent.right
934 right: root.inverted ? parent.left : undefined
938 readonly property var hoveredItem: dndArea.containsMouse ? launcherListView.itemAt(dndArea.mouseX, dndArea.mouseY + launcherListView.realContentY) : null
939 readonly property int itemCenter: !hoveredItem ? 0 : root.mapFromItem(hoveredItem, 0, 0).y + (hoveredItem.height / 2) + hoveredItem.offset
941 text: !hoveredItem ? "" : hoveredItem.name
945 id: tooltipStateMachine
946 initialState: tooltipHiddenState
950 id: tooltipHiddenState
952 DSM.SignalTransition {
953 targetState: tooltipShownState
954 signal: tooltipShape.hoveredItemChanged
955 // !dndArea.pressed allows us to filter out touch input events
956 guard: tooltipShape.hoveredItem !== null && !dndArea.pressed && !root.moving
961 id: tooltipShownState
963 DSM.SignalTransition {
964 targetState: tooltipHiddenState
965 signal: tooltipShape.hoveredItemChanged
966 guard: tooltipShape.hoveredItem === null
969 DSM.SignalTransition {
970 targetState: tooltipDismissedState
971 signal: dndArea.onPressed
974 DSM.SignalTransition {
975 targetState: tooltipDismissedState
976 signal: quickList.stateChanged
977 guard: quickList.state === "open"
982 id: tooltipDismissedState
984 DSM.SignalTransition {
985 targetState: tooltipHiddenState
986 signal: dndArea.positionChanged
987 guard: quickList.state != "open" && !dndArea.pressed && !dndArea.moving
990 DSM.SignalTransition {
991 targetState: tooltipHiddenState
992 signal: dndArea.exited
993 guard: quickList.state != "open"