Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/WallpaperDelegate.qml
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 54 | Rectangle { | |||
---|---|---|---|---|---|
107 | } | 107 | } | ||
108 | PlasmaComponents.ToolButton { | 108 | PlasmaComponents.ToolButton { | ||
109 | anchors { | 109 | anchors { | ||
110 | top: parent.top | 110 | top: parent.top | ||
111 | right: parent.right | 111 | right: parent.right | ||
112 | margins: units.smallSpacing | 112 | margins: units.smallSpacing | ||
113 | } | 113 | } | ||
114 | iconSource: "list-remove" | 114 | iconSource: "list-remove" | ||
115 | tooltip: i18nd("plasma_applet_org.kde.image", "Remove wallpaper") | 115 | tooltip: i18nd("plasma_wallpaper_org.kde.image", "Remove wallpaper") | ||
116 | flat: false | 116 | flat: false | ||
117 | visible: model.removable && !model.pendingDeletion | 117 | visible: model.removable && !model.pendingDeletion | ||
118 | onClicked: { | 118 | onClicked: { | ||
119 | imageWallpaper.wallpaperModel.setPendingDeletion(index, true); | 119 | imageWallpaper.wallpaperModel.setPendingDeletion(index, true); | ||
120 | if (wallpapersGrid.currentIndex === index) { | 120 | if (wallpapersGrid.currentIndex === index) { | ||
121 | wallpapersGrid.currentIndex = (index + 1) % wallpapersGrid.count; | 121 | wallpapersGrid.currentIndex = (index + 1) % wallpapersGrid.count; | ||
122 | } | 122 | } | ||
123 | } | 123 | } | ||
124 | opacity: wallpaperDelegate.containsMouse ? 1 : 0 | 124 | opacity: wallpaperDelegate.containsMouse ? 1 : 0 | ||
125 | Behavior on opacity { | 125 | Behavior on opacity { | ||
126 | PropertyAnimation { | 126 | PropertyAnimation { | ||
127 | duration: units.longDuration | 127 | duration: units.longDuration | ||
128 | easing.type: Easing.OutQuad | 128 | easing.type: Easing.OutQuad | ||
129 | } | 129 | } | ||
130 | } | 130 | } | ||
131 | } | 131 | } | ||
132 | 132 | | |||
133 | PlasmaComponents.ToolButton { | 133 | PlasmaComponents.ToolButton { | ||
134 | anchors { | 134 | anchors { | ||
135 | top: parent.top | 135 | top: parent.top | ||
136 | left: parent.left | 136 | left: parent.left | ||
137 | margins: units.smallSpacing | 137 | margins: units.smallSpacing | ||
138 | } | 138 | } | ||
139 | iconSource: "document-open-folder" | 139 | iconSource: "document-open-folder" | ||
140 | tooltip: i18nd("plasma_applet_org.kde.image", "Open Containing Folder") | 140 | tooltip: i18nd("plasma_wallpaper_org.kde.image", "Open Containing Folder") | ||
141 | flat: false | 141 | flat: false | ||
142 | onClicked: imageWallpaper.wallpaperModel.openContainingFolder(index) | 142 | onClicked: imageWallpaper.wallpaperModel.openContainingFolder(index) | ||
143 | opacity: wallpaperDelegate.containsMouse ? 1 : 0 | 143 | opacity: wallpaperDelegate.containsMouse ? 1 : 0 | ||
144 | Behavior on opacity { | 144 | Behavior on opacity { | ||
145 | PropertyAnimation { | 145 | PropertyAnimation { | ||
146 | duration: units.longDuration | 146 | duration: units.longDuration | ||
147 | easing.type: Easing.OutQuad | 147 | easing.type: Easing.OutQuad | ||
148 | } | 148 | } | ||
149 | } | 149 | } | ||
150 | } | 150 | } | ||
151 | 151 | | |||
152 | PlasmaComponents.ToolButton { | 152 | PlasmaComponents.ToolButton { | ||
153 | anchors { | 153 | anchors { | ||
154 | top: parent.top | 154 | top: parent.top | ||
155 | right: parent.right | 155 | right: parent.right | ||
156 | margins: units.smallSpacing | 156 | margins: units.smallSpacing | ||
157 | } | 157 | } | ||
158 | iconSource: "edit-undo" | 158 | iconSource: "edit-undo" | ||
159 | tooltip: i18nd("plasma_applet_org.kde.image", "Restore wallpaper") | 159 | tooltip: i18nd("plasma_wallpaper_org.kde.image", "Restore wallpaper") | ||
160 | flat: false | 160 | flat: false | ||
161 | visible: model.pendingDeletion | 161 | visible: model.pendingDeletion | ||
162 | onClicked: imageWallpaper.wallpaperModel.setPendingDeletion(index, !model.pendingDeletion) | 162 | onClicked: imageWallpaper.wallpaperModel.setPendingDeletion(index, !model.pendingDeletion) | ||
163 | opacity: wallpaperDelegate.containsMouse ? 1 : 0 | 163 | opacity: wallpaperDelegate.containsMouse ? 1 : 0 | ||
164 | Behavior on opacity { | 164 | Behavior on opacity { | ||
165 | PropertyAnimation { | 165 | PropertyAnimation { | ||
166 | duration: units.longDuration | 166 | duration: units.longDuration | ||
167 | easing.type: Easing.OutQuad | 167 | easing.type: Easing.OutQuad | ||
Show All 21 Lines | |||||
189 | Timer { | 189 | Timer { | ||
190 | interval: 1000 // FIXME TODO: Use platform value for tooltip activation delay. | 190 | interval: 1000 // FIXME TODO: Use platform value for tooltip activation delay. | ||
191 | 191 | | |||
192 | running: wallpaperDelegate.containsMouse && !pressed && model.display | 192 | running: wallpaperDelegate.containsMouse && !pressed && model.display | ||
193 | 193 | | |||
194 | onTriggered: { | 194 | onTriggered: { | ||
195 | if (model.author) { | 195 | if (model.author) { | ||
196 | Tooltip.showText(wallpaperDelegate, Qt.point(wallpaperDelegate.mouseX, wallpaperDelegate.mouseY), | 196 | Tooltip.showText(wallpaperDelegate, Qt.point(wallpaperDelegate.mouseX, wallpaperDelegate.mouseY), | ||
197 | i18nd("plasma_applet_org.kde.image", "%1 by %2", model.display, model.author)); | 197 | i18nd("plasma_wallpaper_org.kde.image", "%1 by %2", model.display, model.author)); | ||
198 | } else { | 198 | } else { | ||
199 | Tooltip.showText(wallpaperDelegate, Qt.point(wallpaperDelegate.mouseX, wallpaperDelegate.mouseY), | 199 | Tooltip.showText(wallpaperDelegate, Qt.point(wallpaperDelegate.mouseX, wallpaperDelegate.mouseY), | ||
200 | model.display); | 200 | model.display); | ||
201 | } | 201 | } | ||
202 | } | 202 | } | ||
203 | } | 203 | } | ||
204 | 204 | | |||
205 | onClicked: { | 205 | onClicked: { | ||
206 | wallpapersGrid.currentIndex = index | 206 | wallpapersGrid.currentIndex = index | ||
207 | wallpapersGrid.forceActiveFocus(); | 207 | wallpapersGrid.forceActiveFocus(); | ||
208 | } | 208 | } | ||
209 | 209 | | |||
210 | onExited: Tooltip.hideText() | 210 | onExited: Tooltip.hideText() | ||
211 | } | 211 | } |