Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/config.qml
Show All 14 Lines | |||||
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software | ||
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.Dialogs 1.1 as QtDialogs | | |||
24 | import QtQuick.Layouts 1.0 | 23 | import QtQuick.Layouts 1.0 | ||
25 | import QtQuick.Window 2.0 // for Screen | 24 | import QtQuick.Window 2.0 // for Screen | ||
26 | //We need units from it | 25 | //We need units from it | ||
27 | import org.kde.plasma.core 2.0 as Plasmacore | 26 | import org.kde.plasma.core 2.0 as Plasmacore | ||
28 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper | 27 | import org.kde.plasma.wallpapers.image 2.0 as Wallpaper | ||
28 | import org.kde.kquickcontrols 2.0 as KQuickControls | ||||
29 | import org.kde.kquickcontrolsaddons 2.0 | 29 | import org.kde.kquickcontrolsaddons 2.0 | ||
30 | import org.kde.kconfig 1.0 // for KAuthorized | 30 | import org.kde.kconfig 1.0 // for KAuthorized | ||
31 | import org.kde.draganddrop 2.0 as DragDrop | 31 | import org.kde.draganddrop 2.0 as DragDrop | ||
32 | import org.kde.kcm 1.1 as KCM | 32 | import org.kde.kcm 1.1 as KCM | ||
33 | 33 | | |||
34 | ColumnLayout { | 34 | ColumnLayout { | ||
35 | id: root | 35 | id: root | ||
36 | property alias cfg_Color: colorDialog.color | 36 | property alias cfg_Color: colorButton.color | ||
37 | property string cfg_Image | 37 | property string cfg_Image | ||
38 | property int cfg_FillMode | 38 | property int cfg_FillMode | ||
39 | property alias cfg_Blur: blurRadioButton.checked | 39 | property alias cfg_Blur: blurRadioButton.checked | ||
40 | property var cfg_SlidePaths: "" | 40 | property var cfg_SlidePaths: "" | ||
41 | property int cfg_SlideInterval: 0 | 41 | property int cfg_SlideInterval: 0 | ||
42 | 42 | | |||
43 | function saveConfig() { | 43 | function saveConfig() { | ||
44 | imageWallpaper.commitDeletion(); | 44 | imageWallpaper.commitDeletion(); | ||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 135 | Row { | |||
145 | } | 145 | } | ||
146 | QtControls.RadioButton { | 146 | QtControls.RadioButton { | ||
147 | id: blurRadioButton | 147 | id: blurRadioButton | ||
148 | text: i18nd("plasma_wallpaper_org.kde.image", "Blur") | 148 | text: i18nd("plasma_wallpaper_org.kde.image", "Blur") | ||
149 | exclusiveGroup: backgroundGroup | 149 | exclusiveGroup: backgroundGroup | ||
150 | } | 150 | } | ||
151 | } | 151 | } | ||
152 | 152 | | |||
153 | QtDialogs.ColorDialog { | | |||
154 | id: colorDialog | | |||
155 | modality: Qt.WindowModal | | |||
156 | showAlphaChannel: false | | |||
157 | title: i18nd("plasma_wallpaper_org.kde.image", "Select Background Color") | | |||
158 | } | | |||
159 | | ||||
160 | Row { | 153 | Row { | ||
161 | id: colorRow | 154 | id: colorRow | ||
162 | visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad | 155 | visible: cfg_FillMode === Image.PreserveAspectFit || cfg_FillMode === Image.Pad | ||
163 | spacing: units.largeSpacing / 2 | 156 | spacing: units.largeSpacing / 2 | ||
164 | QtControls.Label { | 157 | QtControls.Label { | ||
165 | width: formAlignment - units.largeSpacing | 158 | width: formAlignment - units.largeSpacing | ||
166 | } | 159 | } | ||
167 | QtControls.RadioButton { | 160 | QtControls.RadioButton { | ||
168 | id: colorRadioButton | 161 | id: colorRadioButton | ||
169 | text: i18nd("plasma_wallpaper_org.kde.image", "Solid color") | 162 | text: i18nd("plasma_wallpaper_org.kde.image", "Solid color") | ||
170 | exclusiveGroup: backgroundGroup | 163 | exclusiveGroup: backgroundGroup | ||
171 | checked: !cfg_Blur | 164 | checked: !cfg_Blur | ||
172 | } | 165 | } | ||
173 | QtControls.Button { | 166 | KQuickControls.ColorButton { | ||
174 | id: colorButton | 167 | id: colorButton | ||
175 | width: units.gridUnit * 3 | 168 | dialogTitle: i18nd("plasma_wallpaper_org.kde.image", "Select Background Color") | ||
176 | text: " " // needed to it gets a proper height... | | |||
177 | onClicked: colorDialog.open() | | |||
178 | | ||||
179 | Rectangle { | | |||
180 | id: colorRect | | |||
181 | anchors.centerIn: parent | | |||
182 | width: parent.width - 2 * units.smallSpacing | | |||
183 | height: theme.mSize(theme.defaultFont).height | | |||
184 | color: colorDialog.color | | |||
185 | } | | |||
186 | } | 169 | } | ||
187 | } | 170 | } | ||
188 | 171 | | |||
189 | Component { | 172 | Component { | ||
190 | id: foldersComponent | 173 | id: foldersComponent | ||
191 | ColumnLayout { | 174 | ColumnLayout { | ||
192 | anchors.fill: parent | 175 | anchors.fill: parent | ||
193 | Connections { | 176 | Connections { | ||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |