Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/config.qml
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 54 | targetSize: { | |||
---|---|---|---|---|---|
58 | // Lock screen configuration case | 58 | // Lock screen configuration case | ||
59 | return Qt.size(Screen.width, Screen.height) | 59 | return Qt.size(Screen.width, Screen.height) | ||
60 | } | 60 | } | ||
61 | onSlidePathsChanged: cfg_SlidePaths = slidePaths | 61 | onSlidePathsChanged: cfg_SlidePaths = slidePaths | ||
62 | onUncheckedSlidesChanged: cfg_UncheckedSlides = uncheckedSlides | 62 | onUncheckedSlidesChanged: cfg_UncheckedSlides = uncheckedSlides | ||
63 | onSlideshowModeChanged: cfg_SlideshowMode = slideshowMode | 63 | onSlideshowModeChanged: cfg_SlideshowMode = slideshowMode | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | onCfg_FillModeChanged: { | ||||
67 | resizeComboBox.setMethod() | ||||
68 | } | ||||
69 | | ||||
66 | onCfg_SlidePathsChanged: { | 70 | onCfg_SlidePathsChanged: { | ||
67 | imageWallpaper.slidePaths = cfg_SlidePaths | 71 | imageWallpaper.slidePaths = cfg_SlidePaths | ||
68 | } | 72 | } | ||
69 | onCfg_UncheckedSlidesChanged: { | 73 | onCfg_UncheckedSlidesChanged: { | ||
70 | imageWallpaper.uncheckedSlides = cfg_UncheckedSlides | 74 | imageWallpaper.uncheckedSlides = cfg_UncheckedSlides | ||
71 | } | 75 | } | ||
72 | 76 | | |||
73 | onCfg_SlideshowModeChanged: { | 77 | onCfg_SlideshowModeChanged: { | ||
Show All 35 Lines | 92 | model: [ | |||
109 | ] | 113 | ] | ||
110 | 114 | | |||
111 | textRole: "label" | 115 | textRole: "label" | ||
112 | onCurrentIndexChanged: cfg_FillMode = model[currentIndex]["fillMode"] | 116 | onCurrentIndexChanged: cfg_FillMode = model[currentIndex]["fillMode"] | ||
113 | Component.onCompleted: setMethod(); | 117 | Component.onCompleted: setMethod(); | ||
114 | 118 | | |||
115 | function setMethod() { | 119 | function setMethod() { | ||
116 | for (var i = 0; i < model.length; i++) { | 120 | for (var i = 0; i < model.length; i++) { | ||
117 | if (model[i]["fillMode"] === wallpaper.configuration.FillMode) { | 121 | if (model[i]["fillMode"] === root.cfg_FillMode) { | ||
118 | resizeComboBox.currentIndex = i; | 122 | resizeComboBox.currentIndex = i; | ||
119 | var tl = model[i]["label"].length; | 123 | var tl = model[i]["label"].length; | ||
120 | //resizeComboBox.textLength = Math.max(resizeComboBox.textLength, tl+5); | 124 | //resizeComboBox.textLength = Math.max(resizeComboBox.textLength, tl+5); | ||
121 | } | 125 | } | ||
122 | } | 126 | } | ||
123 | } | 127 | } | ||
124 | } | 128 | } | ||
125 | 129 | | |||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Line(s) | |||||
307 | } | 311 | } | ||
308 | 312 | | |||
309 | Component { | 313 | Component { | ||
310 | id: thumbnailsComponent | 314 | id: thumbnailsComponent | ||
311 | KCM.GridView { | 315 | KCM.GridView { | ||
312 | id: wallpapersGrid | 316 | id: wallpapersGrid | ||
313 | anchors.fill: parent | 317 | anchors.fill: parent | ||
314 | property var imageModel: (configDialog.currentWallpaper == "org.kde.image")? imageWallpaper.wallpaperModel : imageWallpaper.slideFilterModel | 318 | property var imageModel: (configDialog.currentWallpaper == "org.kde.image")? imageWallpaper.wallpaperModel : imageWallpaper.slideFilterModel | ||
319 | | ||||
320 | function resetCurrentIndex() { | ||||
315 | //that min is needed as the module will be populated in an async way | 321 | //that min is needed as the module will be populated in an async way | ||
316 | //and only on demand so we can't ensure it already exists | 322 | //and only on demand so we can't ensure it already exists | ||
317 | view.currentIndex: Math.min(imageModel.indexOf(cfg_Image), imageModel.rowCount()-1) | 323 | view.currentIndex = Math.min(imageModel.indexOf(cfg_Image), imageModel.rowCount()-1) | ||
324 | } | ||||
325 | | ||||
326 | Connections { | ||||
327 | target: imageModel | ||||
328 | onRowsInserted: resetCurrentIndex() | ||||
329 | onRowsRemoved: resetCurrentIndex() | ||||
330 | } | ||||
331 | | ||||
332 | Connections { | ||||
333 | target: root | ||||
334 | onCfg_ImageChanged: resetCurrentIndex() | ||||
335 | } | ||||
336 | | ||||
318 | //kill the space for label under thumbnails | 337 | //kill the space for label under thumbnails | ||
319 | view.model: imageModel | 338 | view.model: imageModel | ||
320 | Component.onCompleted: { | 339 | Component.onCompleted: { | ||
321 | imageModel.usedInConfig = true; | 340 | imageModel.usedInConfig = true; | ||
341 | resetCurrentIndex() | ||||
322 | } | 342 | } | ||
323 | view.delegate: WallpaperDelegate { | 343 | view.delegate: WallpaperDelegate { | ||
324 | color: cfg_Color | 344 | color: cfg_Color | ||
325 | } | 345 | } | ||
326 | } | 346 | } | ||
327 | } | 347 | } | ||
328 | 348 | | |||
329 | DragDrop.DropArea { | 349 | DragDrop.DropArea { | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |