@@ -19,6 +19,7 @@ import "components" as Components
19
19
import "code/utils.js" as Utils
20
20
import "code/globals.js" as Globals
21
21
import "code/enum.js" as Enum
22
+ import "code/version.js" as VersionUtil
22
23
23
24
PlasmoidItem {
24
25
id: main
@@ -147,6 +148,7 @@ PlasmoidItem {
147
148
property var panelWidth: panelElement? .width ?? 0
148
149
property var panelHeight: panelElement? .height ?? 0
149
150
property bool debug: plasmoid .configuration .enableDebug
151
+ property var plasmaVersion: new VersionUtil.Version (" 999.999.999" ) // to assume latest
150
152
signal recolorCountChanged ()
151
153
signal refreshNeeded ()
152
154
signal updateUnified ()
@@ -1136,12 +1138,14 @@ PlasmoidItem {
1136
1138
1137
1139
// TODO find where does 16 and 8 come from instead of blindly hardcoding them
1138
1140
property real moveX: {
1139
- let m = horizontal ? 0 : (panelElement? .floating && plasmoid .location === PlasmaCore .Types .RightEdge ? 16 : 0 )
1141
+ const edge = main .plasmaVersion .isLowerThan (" 6.2.0" ) ? PlasmaCore .Types .LeftEdge : PlasmaCore .Types .RightEdge
1142
+ const m = horizontal ? 0 : (panelElement? .floating && plasmoid .location === edge ? 16 : 0 )
1140
1143
return floatigness > 0 ? 8 : m
1141
1144
}
1142
1145
1143
1146
property real moveY: {
1144
- let m = horizontal ? (panelElement? .floating && plasmoid .location === PlasmaCore .Types .BottomEdge ? 16 : 0 ) : 0
1147
+ const edge = main .plasmaVersion .isLowerThan (" 6.2.0" ) ? PlasmaCore .Types .TopEdge : PlasmaCore .Types .BottomEdge
1148
+ const m = horizontal ? (panelElement? .floating && plasmoid .location === edge ? 16 : 0 ) : 0
1145
1149
return floatigness > 0 ? 8 : m
1146
1150
}
1147
1151
@@ -1228,8 +1232,6 @@ PlasmoidItem {
1228
1232
delayed: true
1229
1233
}
1230
1234
1231
- // TODO: should we remove option for blur from per-widget settings?
1232
- // IMO doesn't make much sense to have only some widgets blurred...
1233
1235
Binding {
1234
1236
target: panelElement
1235
1237
property: " panelMask"
@@ -1617,6 +1619,7 @@ PlasmoidItem {
1617
1619
1618
1620
Component .onCompleted : {
1619
1621
bindPlasmoidStatus ()
1622
+ runCommand .run (" plasmashell --version" )
1620
1623
Qt .callLater (function () {
1621
1624
const config = Utils .mergeConfigs (Globals .defaultConfig , cfg)
1622
1625
plasmoid .configuration .globalSettings = Utils .stringify (config)
@@ -1646,9 +1649,10 @@ PlasmoidItem {
1646
1649
console .error (cmd, exitCode, exitStatus, stdout, stderr)
1647
1650
return
1648
1651
}
1652
+ stdout = stdout .trim ()
1649
1653
if (cmd .startsWith (" cat" )) {
1650
1654
try {
1651
- presetContent = JSON .parse (stdout . trim () )
1655
+ presetContent = JSON .parse (stdout)
1652
1656
} catch (e) {
1653
1657
console .error (` Error reading preset (${ cmd} ): ${ e} ` )
1654
1658
return
@@ -1657,6 +1661,11 @@ PlasmoidItem {
1657
1661
plasmoid .configuration .lastPreset = lastPreset
1658
1662
plasmoid .configuration .writeConfig ();
1659
1663
}
1664
+ if (cmd === " plasmashell --version" ) {
1665
+ const parts = stdout .split (" " )
1666
+ if (parts .length < 2 ) return
1667
+ main .plasmaVersion = new VersionUtil.Version (parts[1 ])
1668
+ }
1660
1669
}
1661
1670
}
1662
1671
0 commit comments