@@ -3,6 +3,7 @@ import QtQuick.Layouts
3
3
import org.kde.plasma.core as PlasmaCore
4
4
import org.kde.draganddrop as DragAndDrop
5
5
import org.kde.kirigami as Kirigami
6
+ import org.kde.plasma.plasmoid
6
7
7
8
MouseArea {
8
9
id: launcherIcon
@@ -61,30 +62,28 @@ MouseArea {
61
62
source: " start-here-kde-symbolic"
62
63
width: launcherIcon .iconSize
63
64
height: launcherIcon .iconSize
64
- active: launcherIcon .containsMouse
65
+ active: launcherIcon .containsMouse && ! justOpenedTimer . running
65
66
smooth: true
66
67
}
67
68
68
69
// Debugging
69
70
// Rectangle { anchors.fill: parent; border.color: "#ff0"; color: "transparent"; border.width: 1; }
70
71
// Rectangle { anchors.fill: icon; border.color: "#f00"; color: "transparent"; border.width: 1; }
71
72
73
+ Accessible .name : Plasmoid .title
74
+ Accessible .role : Accessible .Button
72
75
73
76
hoverEnabled: true
74
77
// cursorShape: Qt.PointingHandCursor
75
78
76
- onClicked : {
77
- plasmoid . expanded = ! plasmoid .expanded
78
- }
79
+ property bool wasExpanded
80
+ onPressed : wasExpanded = widget .expanded
81
+ onClicked : widget . expanded = ! wasExpanded
79
82
80
83
property alias activateOnDrag: dropArea .enabled
81
84
DragAndDrop .DropArea {
82
85
id: dropArea
83
86
anchors .fill : parent
84
-
85
- onDragEnter: {
86
- dragHoverTimer .restart ()
87
- }
88
87
}
89
88
90
89
onContainsMouseChanged: {
@@ -96,6 +95,7 @@ MouseArea {
96
95
Timer {
97
96
id: dragHoverTimer
98
97
interval: 250 // Same as taskmanager's activationTimer in MouseHandler.qml
99
- onTriggered: plasmoid .expanded = true
98
+ running: dropArea .containsDrag
99
+ onTriggered: widget .expanded = true
100
100
}
101
101
}
0 commit comments