Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/config.qml
Show All 28 Lines | |||||
29 | 29 | | |||
30 | ColumnLayout { | 30 | ColumnLayout { | ||
31 | id: root | 31 | id: root | ||
32 | property alias cfg_Color: colorDialog.color | 32 | property alias cfg_Color: colorDialog.color | ||
33 | property string cfg_Image | 33 | property string cfg_Image | ||
34 | property int cfg_FillMode | 34 | property int cfg_FillMode | ||
35 | property var cfg_SlidePaths: "" | 35 | property var cfg_SlidePaths: "" | ||
36 | property int cfg_SlideInterval: 0 | 36 | property int cfg_SlideInterval: 0 | ||
37 | signal restoreIndex(int count) | | |||
38 | 37 | | |||
39 | function saveConfig() { | 38 | function saveConfig() { | ||
40 | root.restoreIndex(imageWallpaper.wallpaperModel.count) | | |||
41 | imageWallpaper.commitDeletion(); | 39 | imageWallpaper.commitDeletion(); | ||
davidedmundson: Why even do anything?
You're selecting the currently selected item again. Which does nothing. | |||||
42 | } | 40 | } | ||
43 | 41 | | |||
44 | SystemPalette { | 42 | SystemPalette { | ||
45 | id: syspal | 43 | id: syspal | ||
46 | } | 44 | } | ||
47 | 45 | | |||
48 | Wallpaper.Image { | 46 | Wallpaper.Image { | ||
49 | id: imageWallpaper | 47 | id: imageWallpaper | ||
▲ Show 20 Lines • Show All 243 Lines • ▼ Show 20 Line(s) | 279 | GridView { | |||
293 | delegate: WallpaperDelegate { | 291 | delegate: WallpaperDelegate { | ||
294 | color: cfg_Color | 292 | color: cfg_Color | ||
295 | } | 293 | } | ||
296 | 294 | | |||
297 | onContentHeightChanged: { | 295 | onContentHeightChanged: { | ||
298 | wallpapersGrid.currentIndex = imageWallpaper.wallpaperModel.indexOf(cfg_Image); | 296 | wallpapersGrid.currentIndex = imageWallpaper.wallpaperModel.indexOf(cfg_Image); | ||
299 | wallpapersGrid.positionViewAtIndex(wallpapersGrid.currentIndex, GridView.Visible) | 297 | wallpapersGrid.positionViewAtIndex(wallpapersGrid.currentIndex, GridView.Visible) | ||
300 | } | 298 | } | ||
301 | Connections { | | |||
302 | target: root | | |||
303 | onRestoreIndex: { | | |||
304 | wallpapersGrid.currentIndex = wallpapersGrid.currentIndex - count | | |||
305 | } | | |||
306 | } | | |||
307 | 299 | | |||
308 | Keys.onPressed: { | 300 | Keys.onPressed: { | ||
309 | if (count < 1) { | 301 | if (count < 1) { | ||
310 | return; | 302 | return; | ||
311 | } | 303 | } | ||
312 | 304 | | |||
313 | if (event.key == Qt.Key_Home) { | 305 | if (event.key == Qt.Key_Home) { | ||
314 | currentIndex = 0; | 306 | currentIndex = 0; | ||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |
Why even do anything?
You're selecting the currently selected item again. Which does nothing.
You can surely just delete this (and restoreIndex and the Connection)