MauiKit Image Tools

ColourBar.qml
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import org.mauikit.controls as Maui
6
7ColumnLayout
8{
9 id: control
10
11 spacing: 0
12
13 property Operation currentOperation : _brightnessButton
14
15 component Operation : ToolButton
16 {
17 id: _comp
18 property int value
19 property double stepSize : 10
20 property double from
21 property double to
22 display: ToolButton.TextOnly
23 onValueChanged: slider.value = value
24
25 property Slider slider: Ruler
26 {
27 Layout.fillWidth: true
28
29 Binding on value
30 {
31 value: _comp.value
32 restoreMode: Binding.RestoreBindingOrValue
33 }
34 onMoved: _comp.value = value
35 onValueChanged: _comp.value = value
36 stepSize: _comp.stepSize
37 from: _comp.from
38 to: _comp.to
39 }
40 }
41
42 Maui.ToolBar
43 {
44 id: _sliderToolBar
45 Layout.fillWidth: true
46 middleContent: currentOperation.slider
47 background: Rectangle
48 {
49 color: Maui.Theme.backgroundColor
50 }
51 }
52
53 Maui.ToolBar
54 {
55 position: ToolBar.Footer
56 Layout.fillWidth: true
57
58 background: Rectangle
59 {
60 color: Maui.Theme.backgroundColor
61 }
62
63 middleContent: Row
64 {
65 Layout.alignment: Qt.AlignHCenter
66 spacing: Maui.Style.defaultSpacing
67
68
69
70 Operation
71 {
72 id: _brightnessButton
73 autoExclusive: true
74 checked: currentOperation == this
75 icon.name: "transform-rotate"
76 checkable: true
77 text: i18nc("@action:button Change image brightness", "Brightness");
78
79 Binding on value
80 {
81 value: editor.brightness
82 restoreMode: Binding.RestoreBindingOrValue
83 }
84
85 onClicked:
86 {
87 currentOperation = this
88 editor.applyChanges()
89 }
90
91 from: -255
92 to: 255
93 onValueChanged:
94 {
95 console.log("Adjust staturation", value)
96 editor.adjustBrightness(value)
97 }
98 }
99
100 Operation
101 {
102 checkable: true
103 checked: currentOperation == this
104 autoExclusive: true
105 icon.name: "transform-crop"
106 text: i18nc("@action:button Change image saturation", "Saturation");
107 onClicked:
108 {
109 currentOperation = this
110 editor.applyChanges()
111 }
112
113 // value: editor.saturation
114
115 Binding on value
116 {
117 value: editor.saturation
118 restoreMode: Binding.RestoreBindingOrValue
119 }
120
121 from: -255
122 to: 255
123 onValueChanged:
124 {
125 console.log("Adjust staturation", value)
126 editor.adjustSaturation(value)
127 }
128 }
129
130 Operation
131 {
132 autoExclusive: true
133 icon.name: "transform-rotate"
134 checkable: true
135 text: i18nc("@action:button Change image contrast", "Contrast");
136 onClicked:
137 {
138 currentOperation = this
139 editor.applyChanges()
140 }
141 Binding on value
142 {
143 value: editor.contrast
144 restoreMode: Binding.RestoreBindingOrValue
145 }
146
147 from: -100
148 to: 100
149 stepSize: 1
150 onValueChanged:
151 {
152 console.log("Adjust contrast", value)
153 editor.adjustContrast(value)
154 }
155 }
156
157 Operation
158 {
159 autoExclusive: true
160 icon.name: "transform-rotate"
161 checkable: true
162 text: i18nc("@action:button Change image blur", "Blur");
163 onClicked:
164 {
165 currentOperation = this
166 editor.applyChanges()
167 }
168 Binding on value
169 {
170 value: editor.gaussianBlur
171 restoreMode: Binding.RestoreBindingOrValue
172 }
173
174 from: 0
175 to: 100
176 stepSize: 1
177 onValueChanged:
178 {
179 console.log("Adjust blur", value)
180 editor.adjustGaussianBlur(value)
181 }
182 }
183
184 Operation
185 {
186 autoExclusive: true
187 icon.name: "transform-rotate"
188 checkable: true
189 text: i18nc("@action:button Change image hue", "Hue");
190 onClicked:
191 {
192 currentOperation = this
193 editor.applyChanges()
194 }
195 Binding on value
196 {
197 value: editor.hue
198 restoreMode: Binding.RestoreBindingOrValue
199 }
200
201 from: 0
202 to: 180
203 onValueChanged:
204 {
205 console.log("Adjust hue", value)
206 editor.adjustHue(value)
207 }
208 }
209
210 Operation
211 {
212 autoExclusive: true
213 icon.name: "transform-rotate"
214 checkable: true
215 text: i18nc("@action:button Change image sharpness", "Sharpness");
216 onClicked:
217 {
218 currentOperation = this
219 editor.applyChanges()
220 }
221
222 Binding on value
223 {
224 value: editor.sharpness
225 restoreMode: Binding.RestoreBindingOrValue
226 }
227
228 from: 0
229 to: 100
230 onValueChanged:
231 {
232 editor.adjustSharpness(value)
233 }
234 }
235
236 Operation
237 {
238 autoExclusive: true
239 icon.name: "transform-rotate"
240 checkable: true
241 text: i18nc("@action:button Change image gamma", "Gamma");
242 onClicked:
243 {
244 currentOperation = this
245 editor.applyChanges()
246 }
247
248 Binding on value
249 {
250 value: editor.gamma
251 restoreMode: Binding.RestoreBindingOrValue
252 }
253
254 from: -100
255 to: 100
256 onValueChanged:
257 {
258 editor.adjustGamma(value)
259 }
260 }
261
262 Operation
263 {
264 autoExclusive: true
265 icon.name: "transform-rotate"
266 checkable: true
267 text: i18nc("@action:button Change image threshold", "Threshold");
268 onClicked:
269 {
270 currentOperation = this
271 editor.applyChanges()
272 }
273
274 Binding on value
275 {
276 value: editor.threshold
277 restoreMode: Binding.RestoreBindingOrValue
278 }
279
280 from: 0
281 to: 255
282 onValueChanged:
283 {
284 editor.adjustThreshold(value)
285 }
286 }
287 }
288 }
289}
290
QString i18nc(const char *context, const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:56:08 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.