Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/config.qml
Show All 16 Lines | |||||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.5 | 20 | import QtQuick 2.5 | ||
21 | import QtQuick.Controls 1.0 as QtControls | 21 | import QtQuick.Controls 1.0 as QtControls | ||
22 | import QtQuick.Controls 2.3 as QtControls2 | 22 | import QtQuick.Controls 2.3 as QtControls2 | ||
23 | import QtQuick.Layouts 1.0 | 23 | import QtQuick.Layouts 1.0 | ||
24 | import QtQuick.Window 2.0 // for Screen | 24 | import QtQuick.Window 2.0 // for Screen | ||
25 | //We need units from it | | |||
26 | import org.kde.plasma.core 2.0 as Plasmacore | | |||
27 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper | 25 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper | ||
28 | import org.kde.kquickcontrols 2.0 as KQuickControls | 26 | import org.kde.kquickcontrols 2.0 as KQuickControls | ||
29 | import org.kde.kquickcontrolsaddons 2.0 | 27 | import org.kde.kquickcontrolsaddons 2.0 | ||
30 | import org.kde.kconfig 1.0 // for KAuthorized | 28 | import org.kde.kconfig 1.0 // for KAuthorized | ||
31 | import org.kde.draganddrop 2.0 as DragDrop | 29 | import org.kde.draganddrop 2.0 as DragDrop | ||
32 | import org.kde.kcm 1.1 as KCM | 30 | import org.kde.kcm 1.1 as KCM | ||
33 | import org.kde.kirigami 2.5 as Kirigami | 31 | import org.kde.kirigami 2.5 as Kirigami | ||
34 | 32 | | |||
Show All 38 Lines | 33 | ColumnLayout { | |||
73 | 71 | | |||
74 | TextMetrics { | 72 | TextMetrics { | ||
75 | id: textMetrics | 73 | id: textMetrics | ||
76 | text: "00" | 74 | text: "00" | ||
77 | } | 75 | } | ||
78 | 76 | | |||
79 | Row { | 77 | Row { | ||
80 | //x: formAlignment - positionLabel.paintedWidth | 78 | //x: formAlignment - positionLabel.paintedWidth | ||
81 | spacing: units.largeSpacing / 2 | 79 | spacing: Kirigami.Units.largeSpacing / 2 | ||
82 | QtControls2.Label { | 80 | QtControls2.Label { | ||
83 | id: positionLabel | 81 | id: positionLabel | ||
84 | width: formAlignment - units.largeSpacing | 82 | width: formAlignment - Kirigami.Units.largeSpacing | ||
85 | anchors { | 83 | anchors { | ||
86 | verticalCenter: resizeComboBox.verticalCenter | 84 | verticalCenter: resizeComboBox.verticalCenter | ||
87 | } | 85 | } | ||
88 | text: i18nd("plasma_wallpaper_org.kde.image", "Positioning:") | 86 | text: i18nd("plasma_wallpaper_org.kde.image", "Positioning:") | ||
89 | horizontalAlignment: Text.AlignRight | 87 | horizontalAlignment: Text.AlignRight | ||
90 | } | 88 | } | ||
91 | 89 | | |||
92 | // TODO: port to QQC2 version once we've fixed https://bugs.kde.org/show_bug.cgi?id=403153 | 90 | // TODO: port to QQC2 version once we've fixed https://bugs.kde.org/show_bug.cgi?id=403153 | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 91 | QtControls.ComboBox { | |||
135 | } | 133 | } | ||
136 | } | 134 | } | ||
137 | } | 135 | } | ||
138 | 136 | | |||
139 | QtControls2.ButtonGroup { id: backgroundGroup } | 137 | QtControls2.ButtonGroup { id: backgroundGroup } | ||
140 | 138 | | |||
141 | Row { | 139 | Row { | ||
142 | id: blurRow | 140 | id: blurRow | ||
143 | spacing: units.largeSpacing / 2 | 141 | spacing: Kirigami.Units.largeSpacing / 2 | ||
144 | visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad | 142 | visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad | ||
145 | QtControls2.Label { | 143 | QtControls2.Label { | ||
146 | id: blurLabel | 144 | id: blurLabel | ||
147 | width: formAlignment - units.largeSpacing | 145 | width: formAlignment - Kirigami.Units.largeSpacing | ||
148 | anchors.verticalCenter: blurRadioButton.verticalCenter | 146 | anchors.verticalCenter: blurRadioButton.verticalCenter | ||
149 | horizontalAlignment: Text.AlignRight | 147 | horizontalAlignment: Text.AlignRight | ||
150 | text: i18nd("plasma_wallpaper_org.kde.image", "Background:") | 148 | text: i18nd("plasma_wallpaper_org.kde.image", "Background:") | ||
151 | } | 149 | } | ||
152 | QtControls2.RadioButton { | 150 | QtControls2.RadioButton { | ||
153 | id: blurRadioButton | 151 | id: blurRadioButton | ||
154 | text: i18nd("plasma_wallpaper_org.kde.image", "Blur") | 152 | text: i18nd("plasma_wallpaper_org.kde.image", "Blur") | ||
155 | QtControls2.ButtonGroup.group: backgroundGroup | 153 | QtControls2.ButtonGroup.group: backgroundGroup | ||
156 | } | 154 | } | ||
157 | } | 155 | } | ||
158 | 156 | | |||
159 | Row { | 157 | Row { | ||
160 | id: colorRow | 158 | id: colorRow | ||
161 | visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad | 159 | visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad | ||
162 | spacing: units.largeSpacing / 2 | 160 | spacing: Kirigami.Units.largeSpacing / 2 | ||
163 | QtControls2.Label { | 161 | QtControls2.Label { | ||
164 | width: formAlignment - units.largeSpacing | 162 | width: formAlignment - Kirigami.Units.largeSpacing | ||
165 | } | 163 | } | ||
166 | QtControls2.RadioButton { | 164 | QtControls2.RadioButton { | ||
167 | id: colorRadioButton | 165 | id: colorRadioButton | ||
168 | text: i18nd("plasma_wallpaper_org.kde.image", "Solid color") | 166 | text: i18nd("plasma_wallpaper_org.kde.image", "Solid color") | ||
169 | QtControls2.ButtonGroup.group: backgroundGroup | 167 | QtControls2.ButtonGroup.group: backgroundGroup | ||
170 | checked: !cfg_Blur | 168 | checked: !cfg_Blur | ||
171 | } | 169 | } | ||
172 | KQuickControls.ColorButton { | 170 | KQuickControls.ColorButton { | ||
Show All 10 Lines | 180 | Connections { | |||
183 | target: root | 181 | target: root | ||
184 | onHoursIntervalValueChanged: hoursInterval.value = root.hoursIntervalValue | 182 | onHoursIntervalValueChanged: hoursInterval.value = root.hoursIntervalValue | ||
185 | onMinutesIntervalValueChanged: minutesInterval.value = root.minutesIntervalValue | 183 | onMinutesIntervalValueChanged: minutesInterval.value = root.minutesIntervalValue | ||
186 | onSecondsIntervalValueChanged: secondsInterval.value = root.secondsIntervalValue | 184 | onSecondsIntervalValueChanged: secondsInterval.value = root.secondsIntervalValue | ||
187 | } | 185 | } | ||
188 | //FIXME: there should be only one spinbox: QtControls spinboxes are still too limited for it tough | 186 | //FIXME: there should be only one spinbox: QtControls spinboxes are still too limited for it tough | ||
189 | RowLayout { | 187 | RowLayout { | ||
190 | Layout.fillWidth: true | 188 | Layout.fillWidth: true | ||
191 | spacing: units.largeSpacing / 2 | 189 | spacing: Kirigami.Units.largeSpacing / 2 | ||
192 | QtControls2.Label { | 190 | QtControls2.Label { | ||
193 | Layout.minimumWidth: formAlignment - units.largeSpacing | 191 | Layout.minimumWidth: formAlignment - Kirigami.Units.largeSpacing | ||
194 | horizontalAlignment: Text.AlignRight | 192 | horizontalAlignment: Text.AlignRight | ||
195 | text: i18nd("plasma_wallpaper_org.kde.image","Change every:") | 193 | text: i18nd("plasma_wallpaper_org.kde.image","Change every:") | ||
196 | } | 194 | } | ||
197 | QtControls2.SpinBox { | 195 | QtControls2.SpinBox { | ||
198 | id: hoursInterval | 196 | id: hoursInterval | ||
199 | Layout.minimumWidth: textMetrics.width + units.gridUnit | 197 | Layout.minimumWidth: textMetrics.width + Kirigami.Units.gridUnit | ||
200 | width: units.gridUnit * 3 | 198 | width: Kirigami.Units.gridUnit * 3 | ||
201 | value: root.hoursIntervalValue | 199 | value: root.hoursIntervalValue | ||
202 | from: 0 | 200 | from: 0 | ||
203 | to: 24 | 201 | to: 24 | ||
204 | editable: true | 202 | editable: true | ||
205 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value | 203 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value | ||
206 | } | 204 | } | ||
207 | QtControls2.Label { | 205 | QtControls2.Label { | ||
208 | text: i18nd("plasma_wallpaper_org.kde.image","Hours") | 206 | text: i18nd("plasma_wallpaper_org.kde.image","Hours") | ||
209 | } | 207 | } | ||
210 | Item { | 208 | Item { | ||
211 | Layout.preferredWidth: units.gridUnit | 209 | Layout.preferredWidth: Kirigami.Units.gridUnit | ||
212 | } | 210 | } | ||
213 | QtControls2.SpinBox { | 211 | QtControls2.SpinBox { | ||
214 | id: minutesInterval | 212 | id: minutesInterval | ||
215 | Layout.minimumWidth: textMetrics.width + units.gridUnit | 213 | Layout.minimumWidth: textMetrics.width + Kirigami.Units.gridUnit | ||
216 | width: units.gridUnit * 3 | 214 | width: Kirigami.Units.gridUnit * 3 | ||
217 | value: root.minutesIntervalValue | 215 | value: root.minutesIntervalValue | ||
218 | from: 0 | 216 | from: 0 | ||
219 | to: 60 | 217 | to: 60 | ||
220 | editable: true | 218 | editable: true | ||
221 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value | 219 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value | ||
222 | } | 220 | } | ||
223 | QtControls2.Label { | 221 | QtControls2.Label { | ||
224 | text: i18nd("plasma_wallpaper_org.kde.image","Minutes") | 222 | text: i18nd("plasma_wallpaper_org.kde.image","Minutes") | ||
225 | } | 223 | } | ||
226 | Item { | 224 | Item { | ||
227 | Layout.preferredWidth: units.gridUnit | 225 | Layout.preferredWidth: Kirigami.Units.gridUnit | ||
228 | } | 226 | } | ||
229 | QtControls2.SpinBox { | 227 | QtControls2.SpinBox { | ||
230 | id: secondsInterval | 228 | id: secondsInterval | ||
231 | Layout.minimumWidth: textMetrics.width + units.gridUnit | 229 | Layout.minimumWidth: textMetrics.width + Kirigami.Units.gridUnit | ||
232 | width: units.gridUnit * 3 | 230 | width: Kirigami.Units.gridUnit * 3 | ||
233 | value: root.secondsIntervalValue | 231 | value: root.secondsIntervalValue | ||
234 | from: root.hoursIntervalValue === 0 && root.minutesIntervalValue === 0 ? 1 : 0 | 232 | from: root.hoursIntervalValue === 0 && root.minutesIntervalValue === 0 ? 1 : 0 | ||
235 | to: 60 | 233 | to: 60 | ||
236 | editable: true | 234 | editable: true | ||
237 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value | 235 | onValueChanged: cfg_SlideInterval = hoursInterval.value * 3600 + minutesInterval.value * 60 + secondsInterval.value | ||
238 | } | 236 | } | ||
239 | QtControls2.Label { | 237 | QtControls2.Label { | ||
240 | text: i18nd("plasma_wallpaper_org.kde.image","Seconds") | 238 | text: i18nd("plasma_wallpaper_org.kde.image","Seconds") | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |