@@ -5,7 +5,6 @@ import QtQuick.Layouts
5
5
import org.kde.kcmutils as KCM
6
6
import org.kde.kirigami as Kirigami
7
7
import org.kde.plasma.plasmoid
8
- import org.kde.plasma.plasma5support as P5Support
9
8
10
9
import "components" as Components
11
10
import "code/utils.js" as Utils
@@ -21,6 +20,8 @@ KCM.SimpleKCM {
21
20
property alias cfg_dBusPollingRate: dBusPollingRate .value
22
21
property alias cfg_animatePropertyChanges: animatePropertyChanges .checked
23
22
property alias cfg_animationDuration: animationDuration .value
23
+ property string cfg_editModeGridSettings
24
+ property var editModeGridSettings: JSON .parse (cfg_editModeGridSettings)
24
25
25
26
property string presetsDir: StandardPaths .writableLocation (
26
27
StandardPaths .HomeLocation ).toString ().substring (7 ) + " /.config/panel-colorizer/presets"
@@ -36,16 +37,22 @@ KCM.SimpleKCM {
36
37
}
37
38
}
38
39
40
+ function updateConfig () {
41
+ cfg_editModeGridSettings = JSON .stringify (editModeGridSettings, null , null )
42
+ }
43
+
39
44
ColumnLayout {
40
45
Kirigami .FormLayout {
41
46
id: form
47
+
42
48
CheckBox {
43
49
Kirigami .FormData .label : i18n (" Hide widget:" )
44
50
id: hideWidget
45
51
checked: cfg_hideWidget
46
52
onCheckedChanged: cfg_hideWidget = checked
47
53
text: i18n (" visible in Panel Edit Mode" )
48
54
}
55
+
49
56
CheckBox {
50
57
Kirigami .FormData .label : i18n (" Debug mode:" )
51
58
id: enableDebug
@@ -54,6 +61,136 @@ KCM.SimpleKCM {
54
61
text: i18n (" Show debugging information" )
55
62
}
56
63
64
+ Kirigami .Separator {
65
+ Kirigami .FormData .isSection : true
66
+ Kirigami .FormData .label : i18n (" Grid" )
67
+ Layout .fillWidth : true
68
+ }
69
+
70
+ CheckBox {
71
+ Kirigami .FormData .label : i18n (" Enabled" )
72
+ id: editGridEnabled
73
+ checked: root .editModeGridSettings .enabled
74
+ onCheckedChanged: {
75
+ root .editModeGridSettings .enabled = checked
76
+ root .updateConfig ()
77
+ }
78
+ text: i18n (" Visible while configuring" )
79
+ }
80
+
81
+ RowLayout {
82
+ enabled: editGridEnabled .checked
83
+ Kirigami .FormData .label : i18n (" Background" )
84
+ Components .ColorButton {
85
+ id: bgColorBtn
86
+ showAlphaChannel: false
87
+ dialogTitle: bgColorBtn .Kirigami .FormData .label
88
+ color: root .editModeGridSettings .background .color
89
+ onAccepted : (color ) => {
90
+ root .editModeGridSettings .background .color = color .toString ()
91
+ root .updateConfig ()
92
+ }
93
+ }
94
+ Label {
95
+ text: i18n (" Alpha:" )
96
+ }
97
+ Components .SpinBoxDecimal {
98
+ Layout .preferredWidth : root .Kirigami .Units .gridUnit * 5
99
+ from: 0
100
+ to: 1
101
+ value: root .editModeGridSettings .background .alpha ?? 0
102
+ onValueChanged: {
103
+ root .editModeGridSettings .background .alpha = value
104
+ root .updateConfig ()
105
+ }
106
+ }
107
+ }
108
+
109
+ RowLayout {
110
+ enabled: editGridEnabled .checked
111
+ Kirigami .FormData .label : i18n (" Minor line:" )
112
+ Components .ColorButton {
113
+ id: minorLineColorBtn
114
+ showAlphaChannel: false
115
+ dialogTitle: minorLineColorBtn .Kirigami .FormData .label
116
+ color: root .editModeGridSettings .minorLine .color
117
+ onAccepted : (color ) => {
118
+ root .editModeGridSettings .minorLine .color = color .toString ()
119
+ root .updateConfig ()
120
+ }
121
+ }
122
+ Label {
123
+ text: i18n (" Alpha:" )
124
+ }
125
+ Components .SpinBoxDecimal {
126
+ Layout .preferredWidth : root .Kirigami .Units .gridUnit * 5
127
+ from: 0
128
+ to: 1
129
+ value: root .editModeGridSettings .minorLine .alpha ?? 0
130
+ onValueChanged: {
131
+ root .editModeGridSettings .minorLine .alpha = value
132
+ root .updateConfig ()
133
+ }
134
+ }
135
+ Label {
136
+ text: i18n (" spacing" )
137
+ }
138
+ SpinBox {
139
+ from: 1
140
+ to: 99999
141
+ stepSize: 1
142
+ value: root .editModeGridSettings .spacing
143
+ onValueModified: {
144
+ root .editModeGridSettings .spacing = value
145
+ root .updateConfig ()
146
+ }
147
+ }
148
+ }
149
+
150
+ RowLayout {
151
+ enabled: editGridEnabled .checked
152
+ Kirigami .FormData .label : i18n (" Major line:" )
153
+ Components .ColorButton {
154
+ id: majorLineColorBtn
155
+ showAlphaChannel: false
156
+ dialogTitle: majorLineColorBtn .Kirigami .FormData .label
157
+ color: root .editModeGridSettings .majorLine .color
158
+ onAccepted : (color ) => {
159
+ root .editModeGridSettings .majorLine .color = color .toString ()
160
+ root .updateConfig ()
161
+ }
162
+ enabled: majorLineEverySpinbox .value !== 0
163
+ }
164
+ Label {
165
+ text: i18n (" Alpha:" )
166
+ }
167
+ Components .SpinBoxDecimal {
168
+ Layout .preferredWidth : root .Kirigami .Units .gridUnit * 5
169
+ from: 0
170
+ to: 1
171
+ value: root .editModeGridSettings .majorLine .alpha ?? 0
172
+ onValueChanged: {
173
+ root .editModeGridSettings .majorLine .alpha = value
174
+ root .updateConfig ()
175
+ }
176
+ enabled: majorLineEverySpinbox .value !== 0
177
+ }
178
+ Label {
179
+ text: i18n (" every" )
180
+ }
181
+ SpinBox {
182
+ id: majorLineEverySpinbox
183
+ from: 0
184
+ to: 99999
185
+ stepSize: 1
186
+ value: root .editModeGridSettings .majorLineEvery
187
+ onValueModified: {
188
+ root .editModeGridSettings .majorLineEvery = value
189
+ root .updateConfig ()
190
+ }
191
+ }
192
+ }
193
+
57
194
Kirigami .Separator {
58
195
Kirigami .FormData .isSection : true
59
196
Kirigami .FormData .label : i18n (" Property change animations" )
0 commit comments