Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/WallpaperDelegate.qml
Show All 26 Lines | 25 | MouseArea { | |||
---|---|---|---|---|---|
27 | 27 | | |||
28 | width: wallpapersGrid.cellWidth | 28 | width: wallpapersGrid.cellWidth | ||
29 | height: wallpapersGrid.cellHeight | 29 | height: wallpapersGrid.cellHeight | ||
30 | 30 | | |||
31 | property alias color: backgroundRect.color | 31 | property alias color: backgroundRect.color | ||
32 | property bool selected: (wallpapersGrid.currentIndex == index) | 32 | property bool selected: (wallpapersGrid.currentIndex == index) | ||
33 | opacity: model.pendingDeletion ? 0.5 : 1 | 33 | opacity: model.pendingDeletion ? 0.5 : 1 | ||
34 | 34 | | |||
35 | onSelectedChanged: { | | |||
36 | if (selected) { | | |||
37 | cfg_Image = model.path | | |||
38 | } | | |||
39 | } | | |||
40 | | ||||
41 | hoverEnabled: true | 35 | hoverEnabled: true | ||
42 | 36 | | |||
43 | 37 | | |||
44 | //note: this *doesn't* use system colors since it represent a | 38 | //note: this *doesn't* use system colors since it represent a | ||
45 | //skeymorphic photograph rather than a widget | 39 | //skeymorphic photograph rather than a widget | ||
46 | Rectangle { | 40 | Rectangle { | ||
47 | id: background | 41 | id: background | ||
48 | color: "white" | 42 | color: "white" | ||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | |||||
168 | 162 | | |||
169 | onClicked: { | 163 | onClicked: { | ||
170 | wallpapersGrid.currentIndex = index | 164 | wallpapersGrid.currentIndex = index | ||
171 | wallpapersGrid.forceActiveFocus(); | 165 | wallpapersGrid.forceActiveFocus(); | ||
172 | cfg_Image = model.path | 166 | cfg_Image = model.path | ||
173 | } | 167 | } | ||
174 | 168 | | |||
175 | onExited: Tooltip.hideText() | 169 | onExited: Tooltip.hideText() | ||
176 | | ||||
177 | Component.onCompleted: { | | |||
178 | if (cfg_Image == model.path) { | | |||
179 | makeCurrentTimer.pendingIndex = model.index | | |||
180 | makeCurrentTimer.restart() | | |||
181 | } | | |||
182 | } | | |||
183 | } | 170 | } |