Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/config.qml
Show All 40 Lines | 29 | ColumnLayout { | |||
---|---|---|---|---|---|
41 | } | 41 | } | ||
42 | 42 | | |||
43 | SystemPalette { | 43 | SystemPalette { | ||
44 | id: syspal | 44 | id: syspal | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | Wallpaper.Image { | 47 | Wallpaper.Image { | ||
48 | id: imageWallpaper | 48 | id: imageWallpaper | ||
49 | width: wallpaper.configuration.width | 49 | targetSize: Qt.size(plasmoid.width, plasmoid.height) | ||
50 | height: wallpaper.configuration.height | | |||
51 | onSlidePathsChanged: cfg_SlidePaths = slidePaths | 50 | onSlidePathsChanged: cfg_SlidePaths = slidePaths | ||
davidedmundson: we can be improve that I think
configview exports the containment's graphic item as an… | |||||
52 | } | 51 | } | ||
53 | 52 | | |||
54 | onCfg_SlidePathsChanged: { | 53 | onCfg_SlidePathsChanged: { | ||
55 | imageWallpaper.slidePaths = cfg_SlidePaths | 54 | imageWallpaper.slidePaths = cfg_SlidePaths | ||
56 | } | 55 | } | ||
57 | 56 | | |||
58 | property int hoursIntervalValue: Math.floor(cfg_SlideInterval / 3600) | 57 | property int hoursIntervalValue: Math.floor(cfg_SlideInterval / 3600) | ||
59 | property int minutesIntervalValue: Math.floor(cfg_SlideInterval % 3600) / 60 | 58 | property int minutesIntervalValue: Math.floor(cfg_SlideInterval % 3600) / 60 | ||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Line(s) | 256 | QtControls.ScrollView { | |||
274 | 273 | | |||
275 | GridView { | 274 | GridView { | ||
276 | id: wallpapersGrid | 275 | id: wallpapersGrid | ||
277 | model: imageWallpaper.wallpaperModel | 276 | model: imageWallpaper.wallpaperModel | ||
278 | currentIndex: -1 | 277 | currentIndex: -1 | ||
279 | focus: true | 278 | focus: true | ||
280 | 279 | | |||
281 | cellWidth: Math.floor(wallpapersGrid.width / Math.max(Math.floor(wallpapersGrid.width / (units.gridUnit*12)), 3)) | 280 | cellWidth: Math.floor(wallpapersGrid.width / Math.max(Math.floor(wallpapersGrid.width / (units.gridUnit*12)), 3)) | ||
282 | cellHeight: cellWidth / (imageWallpaper.width / imageWallpaper.height) | 281 | cellHeight: Math.round(cellWidth / (imageWallpaper.targetSize.width / imageWallpaper.targetSize.height)) | ||
283 | 282 | | |||
284 | anchors.margins: 4 | 283 | anchors.margins: 4 | ||
285 | boundsBehavior: Flickable.StopAtBounds | 284 | boundsBehavior: Flickable.StopAtBounds | ||
286 | 285 | | |||
287 | delegate: WallpaperDelegate { | 286 | delegate: WallpaperDelegate { | ||
288 | color: cfg_Color | 287 | color: cfg_Color | ||
289 | } | 288 | } | ||
290 | 289 | | |||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |
we can be improve that I think
configview exports the containment's graphic item as an attached property.
Qt.size(plasmoid.width, plasmoid.height)
This means PMC/Plasmoidviewer will still work correclty.
(tested just now)