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 alias brightnessButton: _brightnessButton
14 property alias contrastButton : _contrastButton
15 property alias saturationButton : _saturationButton
16 property Operation currentOperation : _brightnessButton
17
18 component Operation : ToolButton
19 {
20 id: _comp
21 property int value
22 property double stepSize : 10
23 property double from
24 property double to
25 display: ToolButton.TextOnly
26 onValueChanged: slider.value = value
27
28 property Slider slider: Ruler
29 {
30 Layout.fillWidth: true
31
32 Binding on value
33 {
34 value: _comp.value
35 restoreMode: Binding.RestoreBindingOrValue
36 }
37 onMoved: _comp.value = value
38 onValueChanged: _comp.value = value
39 stepSize: _comp.stepSize
40 from: _comp.from
41 to: _comp.to
42 }
43 }
44
45 Maui.ToolBar
46 {
47 id: _sliderToolBar
48 Layout.fillWidth: true
49 middleContent: currentOperation.slider
50 background: Rectangle
51 {
52 color: Maui.Theme.backgroundColor
53 }
54 }
55
56 Maui.ToolBar
57 {
58 position: ToolBar.Footer
59 Layout.fillWidth: true
60
61 background: Rectangle
62 {
63 color: Maui.Theme.backgroundColor
64 }
65
66 middleContent: Row
67 {
68 Layout.alignment: Qt.AlignHCenter
69 spacing: Maui.Style.defaultSpacing
70
71 Operation
72 {
73 id: _brightnessButton
74 autoExclusive: true
75 checked: currentOperation == this
76 icon.name: "transform-rotate"
77 checkable: true
78 text: i18nc("@action:button Rotate an image", "Brightness");
79
80 Binding on value
81 {
82 value: editor.brightness
83 restoreMode: Binding.RestoreBindingOrValue
84 }
85
86 onClicked:
87 {
88 currentOperation = this
89 editor.applyChanges()
90 }
91
92 from: -255
93 to: 255
94 onValueChanged:
95 {
96 console.log("Adjust staturation", value)
97 editor.adjustBrightness(value)
98 }
99 }
100
101 Operation
102 {
103 id: _saturationButton
104 checkable: true
105 checked: currentOperation == this
106 autoExclusive: true
107 icon.name: "transform-crop"
108 text: i18nc("@action:button Crop an image", "Saturation");
109 onClicked:
110 {
111 currentOperation = this
112 editor.applyChanges()
113 }
114
115 // value: editor.saturation
116
117 Binding on value
118 {
119 value: editor.saturation
120 restoreMode: Binding.RestoreBindingOrValue
121 }
122
123 from: -255
124 to: 255
125 onValueChanged:
126 {
127 console.log("Adjust staturation", value)
128 editor.adjustSaturation(value)
129 }
130 }
131
132 Operation
133 {
134 id: _contrastButton
135 autoExclusive: true
136 icon.name: "transform-rotate"
137 checkable: true
138 text: i18nc("@action:button Rotate an image", "Contrast");
139 onClicked:
140 {
141 currentOperation = this
142 editor.applyChanges()
143 }
144 Binding on value
145 {
146 value: editor.contrast
147 restoreMode: Binding.RestoreBindingOrValue
148 }
149
150 from: -255
151 to: 255
152 onValueChanged:
153 {
154 console.log("Adjust contrast", value)
155 editor.adjustContrast(value)
156 }
157 }
158
159 Operation
160 {
161 id: _hueButton
162 autoExclusive: true
163 icon.name: "transform-rotate"
164 checkable: true
165 text: i18nc("@action:button Rotate an image", "Hue");
166 onClicked:
167 {
168 currentOperation = this
169 editor.applyChanges()
170 }
171 Binding on value
172 {
173 value: editor.hue
174 restoreMode: Binding.RestoreBindingOrValue
175 }
176
177 from: 0
178 to: 180
179 onValueChanged:
180 {
181 console.log("Adjust hue", value)
182 editor.adjustHue(value)
183 }
184 }
185
186 Operation
187 {
188 id: _exposureButton
189 autoExclusive: true
190 icon.name: "transform-rotate"
191 checkable: true
192 text: i18nc("@action:button Rotate an image", "Exposure");
193 onClicked:
194 {
195 currentOperation = this
196 editor.applyChanges()
197 }
198 }
199
200 Operation
201 {
202 id: _highlightsButton
203 autoExclusive: true
204 icon.name: "transform-rotate"
205 checkable: true
206 text: i18nc("@action:button Rotate an image", "Highlights");
207 onClicked:
208 {
209 currentOperation = this
210 editor.applyChanges()
211 }
212 }
213
214 Operation
215 {
216 id: _shadowsButton
217 autoExclusive: true
218 icon.name: "transform-rotate"
219 checkable: true
220 text: i18nc("@action:button Rotate an image", "Shadows");
221 onClicked:
222 {
223 currentOperation = this
224 editor.applyChanges()
225 }
226 }
227 }
228
229
230
231 rightContent: ToolButton
232 {
233 // text: i18nd("mauikitimagetools","Cancel")
234 icon.name: "dialog-cancel"
235 onClicked: imageDoc.cancel()
236 }
237 }
238}
239
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 Apr 11 2025 11:57:09 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.