diff options
Diffstat (limited to 'modules/controlcenter')
| -rw-r--r-- | modules/controlcenter/Panes.qml | 6 | ||||
| -rw-r--r-- | modules/controlcenter/Session.qml | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/modules/controlcenter/Panes.qml b/modules/controlcenter/Panes.qml index eba7de1..c239b91 100644 --- a/modules/controlcenter/Panes.qml +++ b/modules/controlcenter/Panes.qml @@ -108,7 +108,7 @@ ClippingRectangle { const diff = Math.abs(root.session.activeIndex - pane.paneIndex); const isActivePane = diff === 0; let shouldBeActive = false; - + if (!layout.initialOpeningComplete) { shouldBeActive = isActivePane; } else { @@ -120,7 +120,7 @@ ClippingRectangle { shouldBeActive = layout.animationComplete; } } - + loader.active = shouldBeActive; } @@ -132,7 +132,7 @@ ClippingRectangle { active: false Component.onCompleted: { - pane.updateActive(); + Qt.callLater(pane.updateActive); } onActiveChanged: { diff --git a/modules/controlcenter/Session.qml b/modules/controlcenter/Session.qml index 0408a1a..5c4bb05 100644 --- a/modules/controlcenter/Session.qml +++ b/modules/controlcenter/Session.qml @@ -16,6 +16,6 @@ QtObject { readonly property EthernetState ethernet: EthernetState {} readonly property LauncherState launcher: LauncherState {} - onActiveChanged: activeIndex = panes.indexOf(active) - onActiveIndexChanged: active = panes[activeIndex] + onActiveChanged: activeIndex = Math.max(0, panes.indexOf(active)) + onActiveIndexChanged: if (panes[activeIndex]) active = panes[activeIndex] } |