Skip to content

Commit b4b8ca4

Browse files
committed
feat: show spinning indicator on the panel being configured
1 parent fedefd9 commit b4b8ca4

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
pragma ComponentBehavior: Bound
2+
import QtQuick 2.15
3+
import org.kde.kirigami as Kirigami
4+
5+
6+
Item {
7+
id: root
8+
anchors.fill: parent
9+
Rectangle {
10+
anchors.centerIn: parent
11+
color: "#7f000000"
12+
height: Math.min(parent.height, parent.width) * 0.75
13+
width: height
14+
radius: height / 2
15+
16+
Kirigami.Icon {
17+
anchors.centerIn: parent
18+
source: "configure"
19+
width: Math.min(parent.height, parent.width)
20+
height: width
21+
smooth: true
22+
color: "#fafafa"
23+
roundToIconSize: false
24+
isMask: true
25+
NumberAnimation on rotation {
26+
from: 0
27+
to: 360
28+
running: true
29+
loops: Animation.Infinite
30+
duration: 3000
31+
}
32+
}
33+
}
34+
35+
36+
Component.onCompleted: console.log("grid created in", root.parent)
37+
}

package/contents/ui/main.qml

+17-2
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,18 @@ PlasmoidItem {
13621362
}
13631363
}
13641364

1365+
property Component configuringIndicator: ConfiguringIndicator {
1366+
id: configuringIndicator
1367+
Component.onCompleted: {
1368+
Plasmoid.onUserConfiguringChanged.connect(function release() {
1369+
if (!Plasmoid.userConfiguring) {
1370+
Plasmoid.onUserConfiguringChanged.disconnect(release)
1371+
configuringIndicator.destroy()
1372+
}
1373+
})
1374+
}
1375+
}
1376+
13651377
onNativePanelBackgroundOpacityChanged: {
13661378
if(!panelElement) return
13671379
Utils.panelOpacity(panelElement, isEnabled, nativePanelBackgroundOpacity)
@@ -1565,11 +1577,14 @@ PlasmoidItem {
15651577

15661578
onShowEditingGridChanged: {
15671579
if (showEditingGrid) {
1568-
gridComponent.createObject(main.panelView, {"z": -1})
1569-
// gridComponent.createObject(main.panelBg, {"z": -1})
1580+
gridComponent.createObject(main.panelView, {"z": -999})
15701581
}
15711582
}
15721583

1584+
Plasmoid.onUserConfiguringChanged: {
1585+
if(Plasmoid.userConfiguring) configuringIndicator.createObject(main.panelBg, {"z": 999})
1586+
}
1587+
15731588
function updateCurrentWidgets() {
15741589
panelWidgets = []
15751590
panelWidgets = Utils.findWidgets(panelLayout, panelWidgets)

0 commit comments

Comments
 (0)