Skip to content

Commit 91f3fa3

Browse files
committed
fix: update panel length on startup to fix shrank fit content panel
A workaround for https://bugs.kde.org/show_bug.cgi?id=489086 refs: #100
1 parent 244ec16 commit 91f3fa3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

package/contents/ui/main.qml

+34
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ PlasmoidItem {
6464
}
6565

6666
property var unifiedBackgroundTracker: []
67+
property bool doPanelLengthFix: false
6768

6869
property var cfg: {
6970
try {
@@ -1122,6 +1123,39 @@ PlasmoidItem {
11221123
Utils.toggleTransparency(containmentItem, nativePanelBackgroundEnabled)
11231124
}
11241125

1126+
// HACK: change panelLayout spacing on startup to trigger a length reload
1127+
// BUG: https://bugs.kde.org/show_bug.cgi?id=489086
1128+
// https://github.com/luisbocanegra/plasma-panel-colorizer/issues/100
1129+
1130+
onPanelLayoutChanged: {
1131+
if (!panelLayout) return
1132+
panelFixTimer.start()
1133+
}
1134+
1135+
Timer {
1136+
id: panelFixTimer
1137+
repeat: false
1138+
interval: 1000
1139+
onTriggered: {
1140+
doPanelLengthFix = true
1141+
doPanelLengthFix = false
1142+
}
1143+
}
1144+
1145+
Binding {
1146+
target: panelLayout
1147+
property: "columnSpacing"
1148+
value: 0
1149+
when: doPanelLengthFix
1150+
}
1151+
1152+
Binding {
1153+
target: panelLayout
1154+
property: "rowSpacing"
1155+
value: 0
1156+
when: doPanelLengthFix
1157+
}
1158+
11251159
onNativePanelBackgroundEnabledChanged: {
11261160
if(!containmentItem) return
11271161
Utils.toggleTransparency(containmentItem, nativePanelBackgroundEnabled)

0 commit comments

Comments
 (0)