@@ -142,7 +142,6 @@ PlasmoidItem {
142
142
Qt .callLater (function () {
143
143
console .error (JSON .stringify (stockPanelSettings))
144
144
let script = Utils .setPanelModeScript (panelPosition, stockPanelSettings)
145
- console .error (" script" , script)
146
145
Utils .evaluateScript (script)
147
146
})
148
147
}
@@ -176,23 +175,14 @@ PlasmoidItem {
176
175
updateMasks ()
177
176
}
178
177
179
- Rectangle {
180
- id: colorHolder
181
- height: 0
182
- width: 0
183
- visible: false
184
- Kirigami .Theme .inherit : false
185
- }
186
-
187
- function getColor (colorCfg , targetIndex , parentColor , itemType ) {
178
+ function getColor (colorCfg , targetIndex , parentColor , itemType , kirigamiColorItem ) {
188
179
let newColor = " transparent"
189
180
switch (colorCfg .sourceType ) {
190
181
case 0 :
191
182
newColor = Utils .rgbToQtColor (Utils .hexToRgb (colorCfg .custom ))
192
183
break
193
184
case 1 :
194
- colorHolder .Kirigami .Theme .colorSet = Kirigami .Theme [colorCfg .systemColorSet ]
195
- newColor = colorHolder .Kirigami .Theme [colorCfg .systemColor ]
185
+ newColor = kirigamiColorItem .Kirigami .Theme [colorCfg .systemColor ]
196
186
break
197
187
case 2 :
198
188
const nextIndex = targetIndex % colorCfg .list .length
@@ -410,11 +400,11 @@ PlasmoidItem {
410
400
} else if ((! fgEnabled && inTray && widgetEnabled)) {
411
401
return trayWidgetBgItem .fgColor
412
402
} else if (separateTray || cfgOverride) {
413
- return getColor (rect .fgColorCfg , targetIndex, rect .color , itemType)
403
+ return getColor (rect .fgColorCfg , targetIndex, rect .color , itemType, fgColorHolder )
414
404
} else if (inTray) {
415
- return getColor (widgetSettings .foregroundColor , trayIndex, rect .color , itemType)
405
+ return getColor (widgetSettings .foregroundColor , trayIndex, rect .color , itemType, fgColorHolder )
416
406
} else {
417
- return getColor (widgetSettings .foregroundColor , targetIndex, rect .color , itemType)
407
+ return getColor (widgetSettings .foregroundColor , targetIndex, rect .color , itemType, fgColorHolder )
418
408
}
419
409
}
420
410
Rectangle {
@@ -425,6 +415,17 @@ PlasmoidItem {
425
415
radius: height / 2
426
416
color: fgColor
427
417
anchors .right : parent .right
418
+ Kirigami .Theme .colorSet : Kirigami .Theme [fgColorCfg .systemColorSet ]
419
+ }
420
+ Rectangle {
421
+ id: bgColorHolder
422
+ height: 6
423
+ width: height
424
+ visible: false
425
+ radius: height / 2
426
+ color: fgColor
427
+ anchors .right : parent .right
428
+ Kirigami .Theme .colorSet : Kirigami .Theme [bgColorCfg .systemColorSet ]
428
429
}
429
430
// Label {
430
431
// id: debugLabel
@@ -437,9 +438,10 @@ PlasmoidItem {
437
438
bottomLeftRadius: bottomLeftRadius
438
439
bottomRightRadius: bottomRightRadius
439
440
}
441
+ Kirigami .Theme .colorSet : Kirigami .Theme [bgColorCfg .systemColorSet ]
440
442
color: {
441
443
if (bgEnabled) {
442
- return getColor (bgColorCfg, targetIndex, null , itemType)
444
+ return getColor (bgColorCfg, targetIndex, null , itemType, rect )
443
445
} else {
444
446
return " transparent"
445
447
}
@@ -692,9 +694,8 @@ PlasmoidItem {
692
694
visible: borderEnabled && Math .min (rect .height , rect .width ) > 1
693
695
property var borderColorCfg: cfg .border .color
694
696
Kirigami .Theme .colorSet : Kirigami .Theme [borderColorCfg .systemColorSet ]
695
- Kirigami .Theme .inherit : ! (borderColorCfg .sourceType === 1 )
696
697
property color borderColor: {
697
- return getColor (borderColorCfg, targetIndex, rect .color , itemType)
698
+ return getColor (borderColorCfg, targetIndex, rect .color , itemType, borderRec )
698
699
}
699
700
700
701
Rectangle {
@@ -812,7 +813,7 @@ PlasmoidItem {
812
813
Kirigami .Theme .colorSet : Kirigami .Theme [shadowColorCfg .systemColorSet ]
813
814
size: (bgShadowEnabled && Math .min (rect .height , rect .width ) > 1 ) ? bgShadow .size : 0
814
815
color: {
815
- return getColor (shadowColorCfg, targetIndex, rect .color , itemType)
816
+ return getColor (shadowColorCfg, targetIndex, rect .color , itemType, rect . shadow )
816
817
}
817
818
xOffset: bgShadow .xOffset
818
819
yOffset: bgShadow .yOffset
@@ -847,7 +848,7 @@ PlasmoidItem {
847
848
anchors .rightMargin : horizontal ? rect .marginRight : undefined
848
849
anchors .topMargin : horizontal ? undefined : rect .marginTop
849
850
anchors .bottomMargin : horizontal ? undefined : rect .marginBottom
850
-
851
+ id : dropShadow
851
852
property var shadowColorCfg: fgShadow .color
852
853
Kirigami .Theme .colorSet : Kirigami .Theme [shadowColorCfg .systemColorSet ]
853
854
horizontalOffset: fgShadow .xOffset
@@ -856,7 +857,7 @@ PlasmoidItem {
856
857
samples: radius * 2 + 1
857
858
spread: 0.35
858
859
color: {
859
- return getColor (shadowColorCfg, targetIndex, rect .color , itemType)
860
+ return getColor (shadowColorCfg, targetIndex, rect .color , itemType, dropShadow )
860
861
}
861
862
source: target .applet
862
863
visible: fgShadowEnabled
0 commit comments