From 55d0dde5518f37ca5ab6632efbee0beaa4e67d16 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 2 Feb 2021 17:39:22 +0200 Subject: [PATCH] load config pages properly for dock settings window --- .../configuration/LatteDockConfiguration.qml | 17 ++++++++--------- .../configuration/pages/AppearanceConfig.qml | 8 ++------ .../configuration/pages/BehaviorConfig.qml | 12 +++--------- .../configuration/pages/EffectsConfig.qml | 9 ++------- .../configuration/pages/TasksConfig.qml | 9 ++------- 5 files changed, 17 insertions(+), 38 deletions(-) diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml index c0ea661d4..4c9777112 100644 --- a/shell/package/contents/configuration/LatteDockConfiguration.qml +++ b/shell/package/contents/configuration/LatteDockConfiguration.qml @@ -401,8 +401,8 @@ FocusScope { QtQuickControls212.StackView { id: pagesStackView - width: currentItem.Layout.maximumWidth - height: currentItem.Layout.maximumHeight + width: currentItem.width + height: currentItem.height property bool forwardSliding: true @@ -442,8 +442,8 @@ FocusScope { } } - onCurrentItemChanged: { - if (!currentItem) { + onDepthChanged: { + if (depth === 0) { pagesStackView.forwardSliding = true; push(behaviorPage); } @@ -461,26 +461,26 @@ FocusScope { anchors.fill: parent active: plasmoid && plasmoid.configuration && latteView sourceComponent: Pages.BehaviorConfig { + id: _behaviorPage readonly property int pageIndex:0 + Component.onCompleted: { + pagesStackView.push(_behaviorPage); + } } } Loader { id: appearanceLoader - anchors.fill: parent active: plasmoid && plasmoid.configuration && latteView sourceComponent: Pages.AppearanceConfig { - id: appearancePage readonly property int pageIndex:1 } } Loader { id: effectsLoader - anchors.fill: parent active: plasmoid && plasmoid.configuration && latteView sourceComponent: Pages.EffectsConfig { - id: effectsPage readonly property int pageIndex:2 } } @@ -490,7 +490,6 @@ FocusScope { model: plasmoid && plasmoid.configuration && latteView ? latteView.extendedInterface.latteTasksModel : 0 Pages.TasksConfig { - id: tasksPage readonly property int pageIndex: tabBar.visibleStaticPages+index } } diff --git a/shell/package/contents/configuration/pages/AppearanceConfig.qml b/shell/package/contents/configuration/pages/AppearanceConfig.qml index c58aade02..67a9069a9 100644 --- a/shell/package/contents/configuration/pages/AppearanceConfig.qml +++ b/shell/package/contents/configuration/pages/AppearanceConfig.qml @@ -34,12 +34,8 @@ import org.kde.latte.private.containment 0.1 as LatteContainment PlasmaComponents.Page { id: page - Layout.maximumWidth: content.width + content.Layout.leftMargin * 2 - Layout.maximumHeight: content.height + units.smallSpacing * 2 - - Component.onCompleted: { - pagesStackView.push(page); - } + width: content.width + content.Layout.leftMargin * 2 + height: content.height + units.smallSpacing * 2 Timer { id: syncGeometry diff --git a/shell/package/contents/configuration/pages/BehaviorConfig.qml b/shell/package/contents/configuration/pages/BehaviorConfig.qml index 8afd05669..67d5f569e 100644 --- a/shell/package/contents/configuration/pages/BehaviorConfig.qml +++ b/shell/package/contents/configuration/pages/BehaviorConfig.qml @@ -35,17 +35,11 @@ import "../../controls" as LatteExtraControls PlasmaComponents.Page { id: page - Layout.maximumWidth: content.width + content.Layout.leftMargin * 2 - Layout.maximumHeight: content.height + units.smallSpacing * 2 - - Component.onCompleted: { - pagesStackView.push(page); - pagesStackView.pop(page); - } + width: content.width + content.Layout.leftMargin * 2 + height: content.height + units.smallSpacing * 2 ColumnLayout { - id: content - + id: content width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2 spacing: dialog.subGroupSpacing anchors.horizontalCenter: parent.horizontalCenter diff --git a/shell/package/contents/configuration/pages/EffectsConfig.qml b/shell/package/contents/configuration/pages/EffectsConfig.qml index fef6bcab4..5be6836e3 100644 --- a/shell/package/contents/configuration/pages/EffectsConfig.qml +++ b/shell/package/contents/configuration/pages/EffectsConfig.qml @@ -37,13 +37,8 @@ import "../../controls" as LatteExtraControls PlasmaComponents.Page { id: page - Layout.maximumWidth: content.width + content.Layout.leftMargin * 2 - Layout.maximumHeight: content.height + units.smallSpacing - - Component.onCompleted: { - pagesStackView.push(page); - pagesStackView.pop(page); - } + width: content.width + content.Layout.leftMargin * 2 + height: content.height + units.smallSpacing ColumnLayout { id: content diff --git a/shell/package/contents/configuration/pages/TasksConfig.qml b/shell/package/contents/configuration/pages/TasksConfig.qml index 004ba2a46..7bd6cc281 100644 --- a/shell/package/contents/configuration/pages/TasksConfig.qml +++ b/shell/package/contents/configuration/pages/TasksConfig.qml @@ -33,18 +33,13 @@ import org.kde.latte.private.tasks 0.1 as LatteTasks PlasmaComponents.Page { id: _tasksPage - Layout.maximumWidth: content.width + content.Layout.leftMargin * 2 - Layout.maximumHeight: content.height + units.smallSpacing * 2 + width: content.width + content.Layout.leftMargin * 2 + height: content.height + units.smallSpacing * 2 property bool disableAllWindowsFunctionality: tasks.configuration.hideAllTasks readonly property bool isCurrentPage: (dialog.currentPage === _tasksPage) - Component.onCompleted: { - pagesStackView.push(_tasksPage); - pagesStackView.pop(_tasksPage); - } - onIsCurrentPageChanged: { if (isCurrentPage && latteView.extendedInterface.latteTasksModel.count>1) { latteView.extendedInterface.appletRequestedVisualIndicator(tasks.id);