Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/platformcontents/touch/ui/config.qml
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 27 | Item { | |||
---|---|---|---|---|---|
42 | 42 | | |||
43 | //Rectangle { color: "orange"; x: formAlignment; width: formAlignment; height: 20 } | 43 | //Rectangle { color: "orange"; x: formAlignment; width: formAlignment; height: 20 } | ||
44 | 44 | | |||
45 | MobileComponets.IconGrid { | 45 | MobileComponets.IconGrid { | ||
46 | id: wallpapersGrid | 46 | id: wallpapersGrid | ||
47 | model: imageWallpaper.wallpaperModel | 47 | model: imageWallpaper.wallpaperModel | ||
48 | 48 | | |||
49 | property int currentIndex: -1 | 49 | property int currentIndex: -1 | ||
50 | onCurrentIndexChanged: { | 50 | function onCurrentIndexChanged() { | ||
51 | currentPage = Math.max(0, Math.floor(currentIndex/pageSize)) | 51 | currentPage = Math.max(0, Math.floor(currentIndex/pageSize)) | ||
52 | } | 52 | } | ||
53 | anchors { | 53 | anchors { | ||
54 | fill: parent | 54 | fill: parent | ||
55 | top: parent.top | 55 | top: parent.top | ||
56 | bottom: parent.bottom | 56 | bottom: parent.bottom | ||
57 | left: parent.left | 57 | left: parent.left | ||
58 | right: parent.right | 58 | right: parent.right | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | delegateWidth: Math.floor(wallpapersGrid.width / Math.max(Math.floor(wallpapersGrid.width / (units.gridUnit*12)), 3)) | 61 | delegateWidth: Math.floor(wallpapersGrid.width / Math.max(Math.floor(wallpapersGrid.width / (units.gridUnit*12)), 3)) | ||
62 | delegateHeight: delegateWidth / 1.6 | 62 | delegateHeight: delegateWidth / 1.6 | ||
63 | 63 | | |||
64 | delegate: WallpaperDelegate {} | 64 | delegate: WallpaperDelegate {} | ||
65 | 65 | | |||
66 | onCountChanged: { | 66 | function onCountChanged() { | ||
67 | wallpapersGrid.currentIndex = imageWallpaper.wallpaperModel.indexOf(cfg_Image); | 67 | wallpapersGrid.currentIndex = imageWallpaper.wallpaperModel.indexOf(cfg_Image); | ||
68 | wallpapersGrid.positionViewAtIndex(wallpapersGrid.currentIndex, GridView.Visible) | 68 | wallpapersGrid.positionViewAtIndex(wallpapersGrid.currentIndex, GridView.Visible) | ||
69 | } | 69 | } | ||
70 | 70 | | |||
71 | Connections { | 71 | Connections { | ||
72 | target: imageWallpaper | 72 | target: imageWallpaper | ||
73 | onCustomWallpaperPicked: wallpapersGrid.currentIndex = 0 | 73 | onCustomWallpaperPicked: wallpapersGrid.currentIndex = 0 | ||
74 | } | 74 | } | ||
75 | } | 75 | } | ||
76 | } | 76 | } |