Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/main.qml
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Line(s) | 29 | MouseArea { | |||
---|---|---|---|---|---|
141 | onWheel: { | 141 | onWheel: { | ||
142 | // Don't propagate unhandled wheel events | 142 | // Don't propagate unhandled wheel events | ||
143 | wheel.accepted = true; | 143 | wheel.accepted = true; | ||
144 | } | 144 | } | ||
145 | 145 | | |||
146 | Containment.onAppletAdded: { | 146 | Containment.onAppletAdded: { | ||
147 | //Allow the plasmoid expander to know in what window it will be | 147 | //Allow the plasmoid expander to know in what window it will be | ||
148 | var plasmoidContainer = plasmoidItemComponent.createObject(invisibleEntriesContainer, {"x": x, "y": y, "applet": applet}); | 148 | var plasmoidContainer = plasmoidItemComponent.createObject(invisibleEntriesContainer, {"x": x, "y": y, "applet": applet}); | ||
149 | | ||||
150 | applet.parent = plasmoidContainer | | |||
151 | applet.anchors.left = plasmoidContainer.left | | |||
152 | applet.anchors.top = plasmoidContainer.top | | |||
153 | applet.anchors.bottom = plasmoidContainer.bottom | | |||
154 | applet.width = plasmoidContainer.height | | |||
155 | applet.visible = true | | |||
156 | plasmoidContainer.visible = true | | |||
157 | | ||||
158 | //This is to make preloading effective, minimizes the scene changes | | |||
159 | if (applet.fullRepresentationItem) { | | |||
160 | applet.fullRepresentationItem.width = expandedRepresentation.width | | |||
161 | applet.fullRepresentationItem.width = expandedRepresentation.height | | |||
162 | applet.fullRepresentationItem.parent = preloadedStorage; | | |||
163 | } else { | | |||
164 | applet.fullRepresentationItemChanged.connect(function() { | | |||
165 | applet.fullRepresentationItem.width = expandedRepresentation.width | | |||
166 | applet.fullRepresentationItem.width = expandedRepresentation.height | | |||
167 | applet.fullRepresentationItem.parent = preloadedStorage; | | |||
168 | }); | | |||
169 | } | | |||
170 | } | 149 | } | ||
171 | 150 | | |||
172 | //being there forces the items to fully load, and they will be reparented in the popup one by one, this item is *never* visible | 151 | //being there forces the items to fully load, and they will be reparented in the popup one by one, this item is *never* visible | ||
173 | Item { | 152 | Item { | ||
174 | id: preloadedStorage | 153 | id: preloadedStorage | ||
175 | visible: false | 154 | visible: false | ||
176 | } | 155 | } | ||
177 | 156 | | |||
178 | Containment.onAppletRemoved: { | | |||
179 | } | | |||
180 | | ||||
181 | Connections { | 157 | Connections { | ||
182 | target: plasmoid | 158 | target: plasmoid | ||
183 | onUserConfiguringChanged: { | 159 | onUserConfiguringChanged: { | ||
184 | if (plasmoid.userConfiguring) { | 160 | if (plasmoid.userConfiguring) { | ||
185 | dialog.visible = false | 161 | dialog.visible = false | ||
186 | } | 162 | } | ||
187 | } | 163 | } | ||
188 | } | 164 | } | ||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 230 | Item { | |||
255 | id: invisibleEntriesContainer | 231 | id: invisibleEntriesContainer | ||
256 | visible: false | 232 | visible: false | ||
257 | Repeater { | 233 | Repeater { | ||
258 | id: tasksRepeater | 234 | id: tasksRepeater | ||
259 | model: statusNotifierModel | 235 | model: statusNotifierModel | ||
260 | 236 | | |||
261 | delegate: StatusNotifierItem {} | 237 | delegate: StatusNotifierItem {} | ||
262 | } | 238 | } | ||
263 | //NOTE: this exists mostly for not causing reference errors | | |||
264 | property QtObject marginHints: QtObject { | | |||
265 | property int left: 0 | | |||
266 | property int top: 0 | | |||
267 | property int right: 0 | | |||
268 | property int bottom: 0 | | |||
269 | } | | |||
270 | } | 239 | } | ||
271 | 240 | | |||
272 | CurrentItemHighLight { | 241 | CurrentItemHighLight { | ||
273 | visualParent: tasksRow | 242 | visualParent: tasksRow | ||
274 | target: root.activeApplet && root.activeApplet.parent.parent == tasksRow ? root.activeApplet.parent : root | 243 | target: root.activeApplet && root.activeApplet.parent && root.activeApplet.parent.inVisibleLayout ? root.activeApplet.parent : root | ||
275 | location: plasmoid.location | 244 | location: plasmoid.location | ||
276 | } | 245 | } | ||
277 | 246 | | |||
278 | DnD.DropArea { | 247 | DnD.DropArea { | ||
279 | anchors.fill: parent | 248 | anchors.fill: parent | ||
280 | 249 | | |||
281 | preventStealing: true; | 250 | preventStealing: true; | ||
282 | 251 | | |||
Show All 39 Lines | 288 | Flow { | |||
322 | height: parent.height - (vertical && expander.visible ? expander.height : 0) | 291 | height: parent.height - (vertical && expander.visible ? expander.height : 0) | ||
323 | width: parent.width - (vertical || !expander.visible ? 0 : expander.width) | 292 | width: parent.width - (vertical || !expander.visible ? 0 : expander.width) | ||
324 | property string skipItems | 293 | property string skipItems | ||
325 | flow: vertical ? Flow.LeftToRight : Flow.TopToBottom | 294 | flow: vertical ? Flow.LeftToRight : Flow.TopToBottom | ||
326 | //To make it look centered | 295 | //To make it look centered | ||
327 | y: Math.round(height/2 - childrenRect.height/2) | 296 | y: Math.round(height/2 - childrenRect.height/2) | ||
328 | x: (expander.visible && LayoutMirroring.enabled ? expander.width : 0) + Math.round(width/2 - childrenRect.width/2) | 297 | x: (expander.visible && LayoutMirroring.enabled ? expander.width : 0) + Math.round(width/2 - childrenRect.width/2) | ||
329 | 298 | | |||
330 | 299 | readonly property var iconSize: root.itemSize + units.smallSpacing | |||
331 | //Do spacing with margins, to correctly compute the number of lines | | |||
332 | property QtObject marginHints: QtObject { | | |||
333 | property int left: Math.round(units.smallSpacing / 2) | | |||
334 | property int top: Math.round(units.smallSpacing / 2) | | |||
335 | property int right: Math.round(units.smallSpacing / 2) | | |||
336 | property int bottom: Math.round(units.smallSpacing / 2) | | |||
337 | } | | |||
338 | 300 | | |||
339 | //add doesn't seem to work used in conjunction with stackBefore/stackAfter | 301 | //add doesn't seem to work used in conjunction with stackBefore/stackAfter | ||
340 | /*add: Transition { | 302 | /*add: Transition { | ||
341 | NumberAnimation { | 303 | NumberAnimation { | ||
342 | property: "scale" | 304 | property: "scale" | ||
343 | from: 0 | 305 | from: 0 | ||
344 | to: 1 | 306 | to: 1 | ||
345 | easing.type: Easing.InQuad | 307 | easing.type: Easing.InQuad | ||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |