From c0f3730686fa2ed6cc89943f37343191cf2c2f7b Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 21 Jun 2013 23:40:41 +0200 Subject: [PATCH 1/6] forward port the scrolling fixes of plasma1 vers --- .../plasmacomponents/qml/private/PageStack.js | 2 +- .../plasmaextracomponents/qml/PageRow.qml | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/declarativeimports/plasmacomponents/qml/private/PageStack.js b/src/declarativeimports/plasmacomponents/qml/private/PageStack.js index 0e0e62764..013e4e600 100644 --- a/src/declarativeimports/plasmacomponents/qml/private/PageStack.js +++ b/src/declarativeimports/plasmacomponents/qml/private/PageStack.js @@ -151,7 +151,7 @@ function initPage(page, properties) { } container.page = page; - if (page.parent == null) { + if (page.parent == null || page.parent == container.pageParent) { container.owner = container; } else { container.owner = page.parent; diff --git a/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml b/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml index c0d691656..0be636f90 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml @@ -125,7 +125,7 @@ Item { return } - scrollAnimation.to = Math.max(0, Math.min(Math.max(0, columnWidth * level - columnWidth), columnWidth*depth- mainFlickable.width)) + scrollAnimation.to = Math.max(0, Math.min(Math.max(0, columnWidth * level - columnWidth), mainFlickable.contentWidth - mainFlickable.width)) scrollAnimation.running = true } @@ -209,7 +209,8 @@ Item { Row { id: root spacing: -100 - width: childrenRect.width - 100 + width: Math.max((depth-1+children[children.length-1].takenColumns) * columnWidth, childrenRect.width - 100) + height: parent.height Behavior on width { NumberAnimation { @@ -291,6 +292,9 @@ Item { // State to be set after previous state change animation has finished property string pendingState: "none" + //how many columns take the page? + property alias takenColumns: actualContainer.takenColumns + // Ensures that transition finish actions are executed // in case the object is destroyed before reaching the // end state of an ongoing transition @@ -308,7 +312,10 @@ Item { right: parent.right rightMargin: 100 } - width: (container.pageDepth >= actualRoot.depth ? Math.min(actualRoot.width, Math.max(1, Math.round(page.implicitWidth/columnWidth))*columnWidth) : columnWidth) + + property int takenColumns: Math.max(1, Math.round(container.page ? container.page.implicitWidth/columnWidth : 1)); + + width: (container.pageDepth >= actualRoot.depth ? Math.min(actualRoot.width, takenColumns*columnWidth) : columnWidth) } Image { @@ -368,6 +375,10 @@ Item { // Performs a push exit transition. function pushExit(replace, immediate, orientationChanges) { + if (replace) { + setState(immediate ? "Hidden" : "Left"); + } + if (actualRoot.visible && immediate) internal.setPageStatus(page, PageStatus.Inactive); if (replace) { @@ -523,8 +534,9 @@ Item { page.parent = owner; } } - - container.destroy(); + container.parent = null; + container.visible = false; + destroy(); } } } From 8e9ae71e19b8bdf93e0e1df7aea96eed851df1b9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 16 Jul 2013 21:16:28 +0200 Subject: [PATCH 2/6] first porting of simple pieces to QtControls --- .../configuration/AppletConfiguration.qml | 39 +++++++++---------- .../ConfigurationContainmentAppearance.qml | 1 + 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml index 0bab3fa70..4bff258f3 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml @@ -17,6 +17,8 @@ */ import QtQuick 2.0 +import QtQuick.Controls 1.0 as QtControls +import QtQuick.Layouts 1.0 import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.core 2.0 as PlasmaCore @@ -30,7 +32,7 @@ Rectangle { property int _m: theme.defaultFont.pointSize //BEGIN properties - color: "lightgray" + color: syspal.window width: 640 height: 480 //END properties @@ -81,24 +83,24 @@ Rectangle { //END connections //BEGIN UI components - Column { + SystemPalette {id: syspal} + + ColumnLayout { id: mainColumn anchors.fill: parent property int implicitWidth: Math.max(contentRow.implicitWidth, buttonsRow.implicitWidth) + 8 property int implicitHeight: contentRow.implicitHeight + buttonsRow.implicitHeight + 8 - Row { + RowLayout { id: contentRow anchors { left: parent.left right: parent.right } - spacing: 4 - height: parent.height - buttonsRow.height - property int implicitWidth: categoriesScroll.implicitWidth + pageScroll.implicitWidth - property int implicitHeight: Math.max(categoriesScroll.implicitHeight, pageScroll.implicitHeight) + Layout.fillHeight: true + Layout.preferredHeight: parent.height - buttonsRow.height - PlasmaExtras.ScrollArea { + QtControls.ScrollView{ id: categoriesScroll anchors { top: parent.top @@ -107,7 +109,6 @@ Rectangle { visible: (configDialog.configModel ? configDialog.configModel.count : 0) + globalConfigModel.count > 1 width: visible ? 100 : 0 implicitWidth: width - implicitHeight: theme.mSize(theme.defaultFont).height * 12 Flickable { id: categoriesView contentWidth: width @@ -120,7 +121,7 @@ Rectangle { id: categories width: parent.width height: Math.max(categoriesView.height, categoriesColumn.height) - color: "white" + color: syspal.base Rectangle { color: theme.highlightColor @@ -134,7 +135,7 @@ Rectangle { } } } - Column { + ColumnLayout { id: categoriesColumn width: parent.width Repeater { @@ -152,16 +153,13 @@ Rectangle { } } } - PlasmaExtras.ScrollArea { + QtControls.ScrollView{ id: pageScroll anchors { top: parent.top bottom: parent.bottom - margins: 4 } - width: parent.width - categoriesScroll.width - 8 - implicitWidth: main.currentPage ? main.currentPage.implicitWidth : 0 - implicitHeight: main.currentPage ? main.currentPage.implicitHeight : 0 + Layout.fillWidth: true Flickable { contentWidth: width contentHeight: main.height @@ -201,14 +199,13 @@ Rectangle { } } } - Row { + RowLayout { id: buttonsRow - spacing: 4 anchors { right: parent.right rightMargin: spacing } - PlasmaComponents.Button { + QtControls.Button { iconSource: "dialog-ok" text: "Ok" onClicked: { @@ -220,7 +217,7 @@ Rectangle { configDialog.close() } } - PlasmaComponents.Button { + QtControls.Button { iconSource: "dialog-ok-apply" text: "Apply" onClicked: { @@ -231,7 +228,7 @@ Rectangle { } } } - PlasmaComponents.Button { + QtControls.Button { iconSource: "dialog-cancel" text: "Cancel" onClicked: configDialog.close() diff --git a/src/shell/qmlpackages/desktop/contents/configuration/ConfigurationContainmentAppearance.qml b/src/shell/qmlpackages/desktop/contents/configuration/ConfigurationContainmentAppearance.qml index 0871c0ae3..b1d49c3eb 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/ConfigurationContainmentAppearance.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/ConfigurationContainmentAppearance.qml @@ -20,6 +20,7 @@ import QtQuick 2.0 import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.configuration 2.0 +import QtQuick.Controls 1.0 as QtControls Column { id: root From 6f8cda6fea2a79900726fd5b47ef2df6e6201109 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 16 Jul 2013 21:20:41 +0200 Subject: [PATCH 3/6] appletconfiguration completely ported --- .../desktop/contents/configuration/AppletConfiguration.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml index 4bff258f3..e09064d0c 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml @@ -19,9 +19,6 @@ import QtQuick 2.0 import QtQuick.Controls 1.0 as QtControls import QtQuick.Layouts 1.0 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.configuration 2.0 @@ -166,7 +163,7 @@ Rectangle { Item { width: parent.width height: childrenRect.height - PlasmaComponents.PageStack { + QtControls.StackView { id: main anchors.fill: parent anchors.margins: 12 From 0234bae6d42a46c48950e30dc09a93bcb5c5b172 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 16 Jul 2013 23:37:20 +0200 Subject: [PATCH 4/6] port category delegate to qtcontrols --- .../desktop/contents/configuration/AppletConfiguration.qml | 5 +++-- .../contents/configuration/ConfigCategoryDelegate.qml | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml index e09064d0c..f853bd4bd 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/AppletConfiguration.qml @@ -99,6 +99,7 @@ Rectangle { QtControls.ScrollView{ id: categoriesScroll + frameVisible: true anchors { top: parent.top bottom: parent.bottom @@ -121,7 +122,7 @@ Rectangle { color: syspal.base Rectangle { - color: theme.highlightColor + color: syspal.highlight width: parent.width height: theme.iconSizes.IconSizeHuge y: index * height @@ -132,7 +133,7 @@ Rectangle { } } } - ColumnLayout { + Column { id: categoriesColumn width: parent.width Repeater { diff --git a/src/shell/qmlpackages/desktop/contents/configuration/ConfigCategoryDelegate.qml b/src/shell/qmlpackages/desktop/contents/configuration/ConfigCategoryDelegate.qml index ff0b7b943..1c4d96e62 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/ConfigCategoryDelegate.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/ConfigCategoryDelegate.qml @@ -17,8 +17,7 @@ */ import QtQuick 2.0 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras +import QtQuick.Controls 1.0 as QtControls import org.kde.plasma.core 2.0 as PlasmaCore MouseArea { @@ -68,7 +67,7 @@ MouseArea { height: width source: model.icon } - PlasmaComponents.Label { + QtControls.Label { anchors { left: parent.left right: parent.right From 9105b715f8eeb632f5a7703b760d17b1c27375a6 Mon Sep 17 00:00:00 2001 From: Benjamin Port Date: Wed, 17 Jul 2013 10:19:31 +0200 Subject: [PATCH 5/6] KJS instead of kjs --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16f44fa7c..ee45ec8a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ find_package(kdeqt5staging REQUIRED NO_MODULE) # Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs: find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver - KConfig KAuth kjs KWallet KDBusAddons + KConfig KAuth KJS KWallet KDBusAddons KI18n KGuiAddons KService KWidgets ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet KTextWidgets XmlGui KCrash) #find_package(KF5Transitional REQUIRED) From 9d6dacddc054da95232d155296e50b10075af6c3 Mon Sep 17 00:00:00 2001 From: Benjamin Port Date: Wed, 17 Jul 2013 10:26:22 +0200 Subject: [PATCH 6/6] Kio was finally renamed KIO --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee45ec8a5..d4d0a4335 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs #find_package(KF5Transitional REQUIRED) # those are not "done" yet: -find_package(Kio REQUIRED NO_MODULE) +find_package(KIO REQUIRED NO_MODULE) find_package(kdeclarative REQUIRED NO_MODULE) # Needed for some includes from KDE/ (KMimeType, etc.)