Changeset View
Changeset View
Standalone View
Standalone View
containments/panel/contents/ui/main.qml
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Line(s) | 143 | //BEGIN connections | |||
---|---|---|---|---|---|
199 | 199 | | |||
200 | Containment.onAppletRemoved: { | 200 | Containment.onAppletRemoved: { | ||
201 | LayoutManager.removeApplet(applet); | 201 | LayoutManager.removeApplet(applet); | ||
202 | checkLastSpacer(); | 202 | checkLastSpacer(); | ||
203 | LayoutManager.save(); | 203 | LayoutManager.save(); | ||
204 | } | 204 | } | ||
205 | 205 | | |||
206 | Plasmoid.onUserConfiguringChanged: { | 206 | Plasmoid.onUserConfiguringChanged: { | ||
207 | containmentSizeSyncTimer.restart(); | ||||
208 | | ||||
207 | if (plasmoid.immutable) { | 209 | if (plasmoid.immutable) { | ||
208 | if (dragOverlay) { | 210 | if (dragOverlay) { | ||
209 | dragOverlay.destroy(); | 211 | dragOverlay.destroy(); | ||
210 | } | 212 | } | ||
211 | return; | 213 | return; | ||
212 | } | 214 | } | ||
213 | 215 | | |||
214 | if (plasmoid.userConfiguring) { | 216 | if (plasmoid.userConfiguring) { | ||
Show All 13 Lines | 229 | } else { | |||
228 | dragOverlay.visible = true; | 230 | dragOverlay.visible = true; | ||
229 | } | 231 | } | ||
230 | } else { | 232 | } else { | ||
231 | dragOverlay.destroy(); | 233 | dragOverlay.destroy(); | ||
232 | } | 234 | } | ||
233 | } | 235 | } | ||
234 | 236 | | |||
235 | Plasmoid.onFormFactorChanged: containmentSizeSyncTimer.restart(); | 237 | Plasmoid.onFormFactorChanged: containmentSizeSyncTimer.restart(); | ||
236 | Plasmoid.onImmutableChanged: containmentSizeSyncTimer.restart(); | 238 | Containment.onEditModeChanged: containmentSizeSyncTimer.restart(); | ||
237 | 239 | | |||
238 | onToolBoxChanged: { | 240 | onToolBoxChanged: { | ||
239 | containmentSizeSyncTimer.restart(); | 241 | containmentSizeSyncTimer.restart(); | ||
240 | if (startupTimer.running) { | 242 | if (startupTimer.running) { | ||
241 | startupTimer.restart(); | 243 | startupTimer.restart(); | ||
242 | } | 244 | } | ||
243 | } | 245 | } | ||
244 | //END connections | 246 | //END connections | ||
▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Line(s) | 412 | onHeightChanged: { | |||
414 | } | 416 | } | ||
415 | } | 417 | } | ||
416 | 418 | | |||
417 | Timer { | 419 | Timer { | ||
418 | id: containmentSizeSyncTimer | 420 | id: containmentSizeSyncTimer | ||
419 | interval: 150 | 421 | interval: 150 | ||
420 | onTriggered: { | 422 | onTriggered: { | ||
421 | dndSpacer.parent = root; | 423 | dndSpacer.parent = root; | ||
422 | currentLayout.x = (isHorizontal && toolBox && Qt.application.layoutDirection === Qt.RightToLeft && !plasmoid.immutable) ? toolBox.width : 0; | 424 | currentLayout.x = (isHorizontal && toolBox && Qt.application.layoutDirection === Qt.RightToLeft && (plasmoid.editMode || plasmoid.userConfiguring)) ? toolBox.width : 0; | ||
423 | currentLayout.y = 0 | 425 | currentLayout.y = 0 | ||
424 | currentLayout.width = root.width - (isHorizontal && toolBox && !plasmoid.immutable ? toolBox.width : 0) | 426 | currentLayout.width = root.width - (isHorizontal && toolBox && (plasmoid.editMode || plasmoid.userConfiguring) ? toolBox.width : 0) | ||
425 | currentLayout.height = root.height - (!isHorizontal && toolBox && !plasmoid.immutable ? toolBox.height : 0) | 427 | currentLayout.height = root.height - (!isHorizontal && toolBox && (plasmoid.editMode || plasmoid.userConfiguring) ? toolBox.height : 0) | ||
426 | currentLayout.isLayoutHorizontal = isHorizontal | 428 | currentLayout.isLayoutHorizontal = isHorizontal | ||
427 | } | 429 | } | ||
428 | } | 430 | } | ||
429 | 431 | | |||
430 | //FIXME: I don't see other ways at the moment a way to see when the UI is REALLY ready | 432 | //FIXME: I don't see other ways at the moment a way to see when the UI is REALLY ready | ||
431 | Timer { | 433 | Timer { | ||
432 | id: startupTimer | 434 | id: startupTimer | ||
433 | interval: 4000 | 435 | interval: 4000 | ||
Show All 11 Lines |