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 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 if (Functions.isValidColor(launcherSettings.homeButtonBackgroundColor)) {
95 return launcherSettings.homeButtonBackgroundColor;
97 if (launcherSettings.homeButtonBackgroundColor != '')
98 console.warn(`Invalid color name '${launcherSettings.homeButtonBackgroundColor}'`);
100 // Inverse of panel's color.
101 return lightMode ? "#111111" : "#FEFEFE";
104 readonly property bool highlighted: root.highlightIndex == -1;
108 schema.id: "com.lomiri.Shell.Launcher"
112 objectName: "dashItem"
113 width: parent.width * .75
115 anchors.centerIn: parent
116 source: homeLogoResolver.resolvedImage
117 rotation: root.rotation
122 objectName: "homeLogoResolver"
124 readonly property url defaultLogo: "file://" + Constants.defaultLogo
127 launcherSettings.logoPictureUri,
128 "image://theme/start-here",
136 activeFocusOnPress: false
137 onClicked: root.showDashHome()
141 styleName: "FocusShape"
143 anchors.margins: units.gu(.5)
145 visible: bfb.highlighted
152 anchors.left: parent.left
153 anchors.right: parent.right
154 height: parent.height - dashItem.height - parent.spacing*2
157 id: launcherListViewItem
163 objectName: "launcherListView"
166 topMargin: -extensionSize + width * .15
167 bottomMargin: -extensionSize + width * .15
169 topMargin: extensionSize
170 bottomMargin: extensionSize
171 height: parent.height - dashItem.height - parent.spacing*2
173 cacheBuffer: itemHeight * 3
174 snapMode: interactive ? ListView.SnapToItem : ListView.NoSnap
175 highlightRangeMode: ListView.ApplyRange
176 preferredHighlightBegin: (height - itemHeight) / 2
177 preferredHighlightEnd: (height + itemHeight) / 2
179 // for the single peeking icon, when alert-state is set on delegate
180 property int peekingIndex: -1
182 // The size of the area the ListView is extended to make sure items are not
183 // destroyed when dragging them outside the list. This needs to be at least
184 // itemHeight to prevent folded items from disappearing and DragArea limits
185 // need to be smaller than this size to avoid breakage.
186 property int extensionSize: itemHeight * 3
188 // Workaround: The snap settings in the launcher, will always try to
189 // snap to what we told it to do. However, we want the initial position
190 // of the launcher to not be centered, but instead start with the topmost
191 // item unfolded completely. Lets wait for the ListView to settle after
192 // creation and then reposition it to 0.
193 // https://bugreports.qt-project.org/browse/QTBUG-32251
194 Component.onCompleted: {
201 launcherListView.moveToIndex(0)
205 // The height of the area where icons start getting folded
206 property int foldingStartHeight: itemHeight
207 // The height of the area where the items reach the final folding angle
208 property int foldingStopHeight: foldingStartHeight - itemHeight - spacing
209 property int itemWidth: width * .75
210 property int itemHeight: itemWidth * 15 / 16 + units.gu(1)
211 property int clickFlickSpeed: units.gu(60)
212 property int draggedIndex: dndArea.draggedIndex
213 property real realContentY: contentY - originY + topMargin
214 property int realItemHeight: itemHeight + spacing
216 // In case the start dragging transition is running, we need to delay the
217 // move because the displaced transition would clash with it and cause items
218 // to be moved to wrong places
219 property bool draggingTransitionRunning: false
220 property int scheduledMoveTo: -1
222 LomiriNumberAnimation {
223 id: snapToBottomAnimation
224 target: launcherListView
226 to: launcherListView.originY + launcherListView.topMargin
229 LomiriNumberAnimation {
230 id: snapToTopAnimation
231 target: launcherListView
233 to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY - launcherListView.topMargin
236 LomiriNumberAnimation {
238 objectName: "moveAnimation"
239 target: launcherListView
241 function moveTo(contentY) {
242 from = launcherListView.contentY;
247 function moveToIndex(index) {
248 var totalItemHeight = launcherListView.itemHeight + launcherListView.spacing
249 var itemPosition = index * totalItemHeight;
250 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
251 var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : totalItemHeight
252 if (itemPosition + totalItemHeight + distanceToEnd > launcherListView.contentY + launcherListView.originY + launcherListView.topMargin + height) {
253 moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd - launcherListView.originY);
254 } else if (itemPosition - distanceToEnd < launcherListView.contentY - launcherListView.originY + launcherListView.topMargin) {
255 moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin + launcherListView.originY);
259 displaced: Transition {
260 NumberAnimation { properties: "x,y"; duration: LomiriAnimation.FastDuration; easing: LomiriAnimation.StandardEasing }
263 delegate: FoldingLauncherDelegate {
265 objectName: "launcherDelegate" + index
266 // We need the appId in the delegate in order to find
267 // the right app when running autopilot tests for
269 readonly property string appId: model.appId
272 itemHeight: launcherListView.itemHeight
273 itemWidth: launcherListView.itemWidth
278 countVisible: model.countVisible
279 progress: model.progress
280 itemRunning: model.running
281 itemFocused: model.focused
282 inverted: root.inverted
283 alerting: model.alerting
284 highlighted: root.highlightIndex == index
285 shortcutHintShown: root.shortcutHintsShown && index <= 9
286 surfaceCount: model.surfaceCount
289 property bool dragging: false
291 SequentialAnimation {
293 objectName: "peekingAnimation" + index
296 PropertyAction { target: root; property: "visible"; value: (launcher.visibleWidth === 0) ? 1 : 0 }
297 PropertyAction { target: launcherListViewItem; property: "clip"; value: 0 }
299 LomiriNumberAnimation {
300 target: launcherDelegate
304 to: (units.gu(.5) + launcherListView.width * .5) * (root.inverted ? -1 : 1)
305 duration: LomiriAnimation.BriskDuration
309 LomiriNumberAnimation {
310 target: launcherDelegate
315 duration: LomiriAnimation.BriskDuration
318 PropertyAction { target: launcherListViewItem; property: "clip"; value: 1 }
319 PropertyAction { target: root; property: "visible"; value: (launcher.visibleWidth === 0) ? 1 : 0 }
320 PropertyAction { target: launcherListView; property: "peekingIndex"; value: -1 }
325 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
326 launcherListView.moveToIndex(index)
327 if (!dragging && launcher.state !== "visible" && launcher.state !== "drawer") {
328 peekingAnimation.start()
332 if (launcherListView.peekingIndex === -1) {
333 launcherListView.peekingIndex = index
336 if (launcherListView.peekingIndex === index) {
337 launcherListView.peekingIndex = -1
344 objectName: "dropIndicator"
345 anchors.centerIn: parent
346 height: visible ? units.dp(2) : 0
347 width: parent.width + mainColumn.anchors.leftMargin + mainColumn.anchors.rightMargin
349 source: "graphics/divider-line.png"
355 when: dndArea.selectedItem === launcherDelegate && fakeDragItem.visible && !dragging
357 target: launcherDelegate
365 target: launcherDelegate
370 target: dropIndicator
376 when: dndArea.draggedIndex >= 0 && (dndArea.preDragging || dndArea.dragging || dndArea.postDragging) && dndArea.draggedIndex != index
378 target: launcherDelegate
390 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.FastDuration }
395 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.FastDuration }
396 LomiriNumberAnimation { properties: "angle,offset" }
401 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.BriskDuration }
402 LomiriNumberAnimation { properties: "angle,offset" }
405 id: draggingTransition
408 SequentialAnimation {
409 PropertyAction { target: launcherListView; property: "draggingTransitionRunning"; value: true }
411 LomiriNumberAnimation { properties: "height" }
412 NumberAnimation { target: dropIndicator; properties: "opacity"; duration: LomiriAnimation.FastDuration }
416 if (launcherListView.scheduledMoveTo > -1) {
417 launcherListView.model.move(dndArea.draggedIndex, launcherListView.scheduledMoveTo)
418 dndArea.draggedIndex = launcherListView.scheduledMoveTo
419 launcherListView.scheduledMoveTo = -1
423 PropertyAction { target: launcherListView; property: "draggingTransitionRunning"; value: false }
429 NumberAnimation { target: dropIndicator; properties: "opacity"; duration: LomiriAnimation.SnapDuration }
430 NumberAnimation { properties: "itemOpacity"; duration: LomiriAnimation.BriskDuration }
431 SequentialAnimation {
432 ScriptAction { script: if (index == launcherListView.count-1) launcherListView.flick(0, -launcherListView.clickFlickSpeed); }
433 LomiriNumberAnimation { properties: "height" }
434 ScriptAction { script: if (index == launcherListView.count-1) launcherListView.flick(0, -launcherListView.clickFlickSpeed); }
435 PropertyAction { target: dndArea; property: "postDragging"; value: false }
436 PropertyAction { target: dndArea; property: "draggedIndex"; value: -1 }
444 objectName: "dndArea"
445 acceptedButtons: Qt.LeftButton | Qt.RightButton
449 topMargin: launcherListView.topMargin
450 bottomMargin: launcherListView.bottomMargin
452 drag.minimumY: -launcherListView.topMargin
453 drag.maximumY: height + launcherListView.bottomMargin
455 property int draggedIndex: -1
456 property var selectedItem
457 property bool preDragging: false
458 property bool dragging: !!selectedItem && selectedItem.dragging
459 property bool postDragging: false
463 // This is a workaround for some issue in the QML ListView:
464 // When calling moveToItem(0), the listview visually positions itself
465 // correctly to display the first item expanded. However, some internal
466 // state seems to not be valid, and the next time the user clicks on it,
467 // it snaps back to the snap boundries before executing the onClicked handler.
468 // This can cause the listview getting stuck in a snapped position where you can't
469 // launch things without first dragging the launcher manually. So lets read the item
470 // angle before that happens and use that angle instead of the one we get in onClicked.
471 property real pressedStartAngle: 0
473 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
474 pressedStartAngle = clickedItem.angle;
478 function processPress(mouse) {
479 selectedItem = launcherListView.itemAt(mouse.x, mouse.y + launcherListView.realContentY)
483 var index = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
484 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
486 // Check if we actually clicked an item or only at the spacing in between
487 if (clickedItem === null) {
491 if (mouse.button & Qt.RightButton) { // context menu
493 quickList.open(index);
499 // First/last item do the scrolling at more than 12 degrees
500 if (index == 0 || index == launcherListView.count - 1) {
501 launcherListView.moveToIndex(index);
502 if (pressedStartAngle <= 12 && pressedStartAngle >= -12) {
503 root.applicationSelected(LauncherModel.get(index).appId);
508 // the rest launches apps up to an angle of 30 degrees
509 if (clickedItem.angle > 30 || clickedItem.angle < -30) {
510 launcherListView.moveToIndex(index);
512 root.applicationSelected(LauncherModel.get(index).appId);
524 function endDrag(dragItem) {
525 var droppedIndex = draggedIndex;
536 selectedItem.dragging = false;
537 selectedItem = undefined;
540 dragItem.target = undefined
542 progressiveScrollingTimer.stop();
543 launcherListView.interactive = true;
544 if (droppedIndex >= launcherListView.count - 2 && postDragging) {
545 snapToBottomAnimation.start();
546 } else if (droppedIndex < 2 && postDragging) {
547 snapToTopAnimation.start();
552 processPressAndHold(mouse, drag);
555 function processPressAndHold(mouse, dragItem) {
556 if (Math.abs(selectedItem.angle) > 30) {
562 draggedIndex = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight);
564 quickList.open(draggedIndex)
566 launcherListView.interactive = false
568 var yOffset = draggedIndex > 0 ? (mouse.y + launcherListView.realContentY) % (draggedIndex * launcherListView.realItemHeight) : mouse.y + launcherListView.realContentY
570 fakeDragItem.iconName = launcherListView.model.get(draggedIndex).icon
571 fakeDragItem.x = units.gu(0.5)
572 fakeDragItem.y = mouse.y - yOffset + launcherListView.anchors.topMargin + launcherListView.topMargin
573 fakeDragItem.angle = selectedItem.angle * (root.inverted ? -1 : 1)
574 fakeDragItem.offset = selectedItem.offset * (root.inverted ? -1 : 1)
575 fakeDragItem.count = LauncherModel.get(draggedIndex).count
576 fakeDragItem.progress = LauncherModel.get(draggedIndex).progress
577 fakeDragItem.flatten()
578 dragItem.target = fakeDragItem
585 processPositionChanged(mouse)
588 function processPositionChanged(mouse) {
589 if (draggedIndex >= 0) {
590 if (selectedItem && !selectedItem.dragging) {
591 var distance = Math.max(Math.abs(mouse.x - startX), Math.abs(mouse.y - startY))
592 if (!preDragging && distance > units.gu(1.5)) {
594 quickList.state = "";
596 if (distance > launcherListView.itemHeight) {
597 selectedItem.dragging = true
603 var itemCenterY = fakeDragItem.y + fakeDragItem.height / 2
605 // Move it down by the the missing size to compensate index calculation with only expanded items
606 itemCenterY += (launcherListView.itemHeight - selectedItem.height) / 2
608 if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - launcherListView.realItemHeight) {
609 progressiveScrollingTimer.downwards = false
610 progressiveScrollingTimer.start()
611 } else if (mouseY < launcherListView.realItemHeight) {
612 progressiveScrollingTimer.downwards = true
613 progressiveScrollingTimer.start()
615 progressiveScrollingTimer.stop()
618 var newIndex = (itemCenterY + launcherListView.realContentY) / launcherListView.realItemHeight
620 if (newIndex > draggedIndex + 1) {
621 newIndex = draggedIndex + 1
622 } else if (newIndex < draggedIndex) {
623 newIndex = draggedIndex -1
628 if (newIndex >= 0 && newIndex < launcherListView.count) {
629 if (launcherListView.draggingTransitionRunning) {
630 launcherListView.scheduledMoveTo = newIndex
632 launcherListView.model.move(draggedIndex, newIndex)
633 draggedIndex = newIndex
640 id: progressiveScrollingTimer
644 property bool downwards: true
647 var minY = -launcherListView.topMargin
648 if (launcherListView.contentY > minY) {
649 launcherListView.contentY = Math.max(launcherListView.contentY - units.dp(2), minY)
652 var maxY = launcherListView.contentHeight - launcherListView.height + launcherListView.topMargin + launcherListView.originY
653 if (launcherListView.contentY < maxY) {
654 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
664 objectName: "fakeDragItem"
665 visible: dndArea.draggedIndex >= 0 && !dndArea.postDragging
666 itemWidth: launcherListView.itemWidth
667 itemHeight: launcherListView.itemHeight
670 rotation: root.rotation
672 onVisibleChanged: if (!visible) iconName = "";
675 fakeDragItemAnimation.start();
678 LomiriNumberAnimation {
679 id: fakeDragItemAnimation
680 target: fakeDragItem;
681 properties: "angle,offset";
690 objectName: "quickListShape"
691 anchors.fill: quickList
692 opacity: quickList.state === "open" ? 0.95 : 0
694 rotation: root.rotation
695 aspect: LomiriShape.Flat
697 // Denotes that the shape is not animating, to prevent race conditions during testing
698 readonly property bool ready: (visible && (!quickListShapeOpacityFade.running))
700 Behavior on opacity {
701 LomiriNumberAnimation {
702 id: quickListShapeOpacityFade
706 source: ShaderEffectSource {
707 sourceItem: quickList
714 rightMargin: -units.dp(4)
715 verticalCenter: parent.verticalCenter
716 verticalCenterOffset: -quickList.offset * (root.inverted ? -1 : 1)
720 source: "graphics/quicklist_tooltip.png"
726 anchors.fill: quickListShape
727 enabled: quickList.state == "open" || pressed
728 hoverEnabled: enabled
732 quickList.state = "";
733 quickList.focus = false;
734 root.kbdNavigationCancelled();
737 // Forward for dragging to work when quickList is open
740 var m = mapToItem(dndArea, mouseX, mouseY)
741 dndArea.processPress(m)
745 var m = mapToItem(dndArea, mouseX, mouseY)
746 dndArea.processPressAndHold(m, drag)
750 var m = mapToItem(dndArea, mouseX, mouseY)
751 dndArea.processPositionChanged(m)
755 dndArea.endDrag(drag);
759 dndArea.endDrag(drag);
765 objectName: "quickList"
766 color: theme.palette.normal.background
767 // Because we're setting left/right anchors depending on orientation, it will break the
768 // width setting after rotating twice. This makes sure we also re-apply width on rotation
769 width: root.inverted ? units.gu(30) : units.gu(30)
770 height: quickListColumn.height
771 visible: quickListShape.visible
773 left: root.inverted ? undefined : parent.right
774 right: root.inverted ? parent.left : undefined
777 y: itemCenter - (height / 2) + offset
778 rotation: root.rotation
781 property string appId
783 property int selectedIndex: -1
788 var prevIndex = selectedIndex;
789 selectedIndex = (selectedIndex + 1 < popoverRepeater.count) ? selectedIndex + 1 : 0;
790 while (!popoverRepeater.itemAt(selectedIndex).clickable && selectedIndex != prevIndex) {
791 selectedIndex = (selectedIndex + 1 < popoverRepeater.count) ? selectedIndex + 1 : 0;
793 event.accepted = true;
796 var prevIndex = selectedIndex;
797 selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : popoverRepeater.count - 1;
798 while (!popoverRepeater.itemAt(selectedIndex).clickable && selectedIndex != prevIndex) {
799 selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : popoverRepeater.count - 1;
801 event.accepted = true;
805 quickList.selectedIndex = -1;
806 quickList.focus = false;
808 event.accepted = true;
813 if (quickList.selectedIndex >= 0) {
814 LauncherModel.quickListActionInvoked(quickList.appId, quickList.selectedIndex)
816 quickList.selectedIndex = -1;
817 quickList.focus = false;
819 root.kbdNavigationCancelled();
820 event.accepted = true;
826 property int itemCenter: item ? root.mapFromItem(quickList.item, 0, 0).y + (item.height / 2) + quickList.item.offset : units.gu(1)
827 property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
828 itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0
830 function open(index) {
831 var itemPosition = index * launcherListView.itemHeight;
832 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
833 item = launcherListView.itemAt(launcherListView.width / 2, itemPosition + launcherListView.itemHeight / 2);
834 quickList.model = launcherListView.model.get(index).quickList;
835 quickList.appId = launcherListView.model.get(index).appId;
836 quickList.state = "open";
837 root.highlightIndex = index;
838 quickList.forceActiveFocus();
843 height: quickListColumn.height
849 var item = quickListColumn.childAt(mouseX, mouseY);
850 if (item.clickable) {
851 quickList.selectedIndex = item.index;
853 quickList.selectedIndex = -1;
861 height: childrenRect.height
865 objectName: "popoverRepeater"
866 model: QuickListProxyModel {
867 source: quickList.model ? quickList.model : null
868 privateMode: root.privateMode
872 readonly property bool clickable: model.clickable
873 readonly property int index: model.index
875 objectName: "quickListEntry" + index
876 selected: index === quickList.selectedIndex
877 height: label.implicitHeight + label.anchors.topMargin + label.anchors.bottomMargin
878 color: model.clickable ? (selected ? theme.palette.highlighted.background : "transparent") : theme.palette.disabled.background
879 highlightColor: !model.clickable ? quickList.color : undefined // make disabled items visually unclickable
880 divider.colorFrom: LomiriColors.inkstone
881 divider.colorTo: LomiriColors.inkstone
882 divider.visible: model.hasSeparator
887 anchors.leftMargin: units.gu(3) // 2 GU for checkmark, 3 GU total
888 anchors.rightMargin: units.gu(2)
889 anchors.topMargin: units.gu(2)
890 anchors.bottomMargin: units.gu(2)
891 verticalAlignment: Label.AlignVCenter
893 fontSize: index == 0 ? "medium" : "small"
894 font.weight: index == 0 ? Font.Medium : Font.Light
895 color: model.clickable ? theme.palette.normal.backgroundText : theme.palette.disabled.backgroundText
896 elide: Text.ElideRight
900 if (!model.clickable) {
904 quickList.state = "";
905 // Unsetting model to prevent showing changing entries during fading out
906 // that may happen because of triggering an action.
907 LauncherModel.quickListActionInvoked(quickList.appId, index);
908 quickList.focus = false;
909 root.kbdNavigationCancelled();
910 quickList.model = undefined;
920 objectName: "tooltipShape"
922 visible: tooltipShownState.active
923 rotation: root.rotation
924 y: itemCenter - (height / 2)
927 left: root.inverted ? undefined : parent.right
928 right: root.inverted ? parent.left : undefined
932 readonly property var hoveredItem: dndArea.containsMouse ? launcherListView.itemAt(dndArea.mouseX, dndArea.mouseY + launcherListView.realContentY) : null
933 readonly property int itemCenter: !hoveredItem ? 0 : root.mapFromItem(hoveredItem, 0, 0).y + (hoveredItem.height / 2) + hoveredItem.offset
935 text: !hoveredItem ? "" : hoveredItem.name
939 id: tooltipStateMachine
940 initialState: tooltipHiddenState
944 id: tooltipHiddenState
946 DSM.SignalTransition {
947 targetState: tooltipShownState
948 signal: tooltipShape.hoveredItemChanged
949 // !dndArea.pressed allows us to filter out touch input events
950 guard: tooltipShape.hoveredItem !== null && !dndArea.pressed && !root.moving
955 id: tooltipShownState
957 DSM.SignalTransition {
958 targetState: tooltipHiddenState
959 signal: tooltipShape.hoveredItemChanged
960 guard: tooltipShape.hoveredItem === null
963 DSM.SignalTransition {
964 targetState: tooltipDismissedState
965 signal: dndArea.onPressed
968 DSM.SignalTransition {
969 targetState: tooltipDismissedState
970 signal: quickList.stateChanged
971 guard: quickList.state === "open"
976 id: tooltipDismissedState
978 DSM.SignalTransition {
979 targetState: tooltipHiddenState
980 signal: dndArea.positionChanged
981 guard: quickList.state != "open" && !dndArea.pressed && !dndArea.moving
984 DSM.SignalTransition {
985 targetState: tooltipHiddenState
986 signal: dndArea.exited
987 guard: quickList.state != "open"