From f35d9909af02e199c88e6fbb5166c5b146bbab37 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 31 Aug 2017 11:52:47 +0200 Subject: [PATCH] better layout for quicksettings and notifications --- .../panel/contents/ui/SlidingPanel.qml | 3 ++- containments/panel/contents/ui/main.qml | 23 ++++++++++++++----- shell/contents/layout.js | 5 +++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/containments/panel/contents/ui/SlidingPanel.qml b/containments/panel/contents/ui/SlidingPanel.qml index 46623427..dc7cebde 100644 --- a/containments/panel/contents/ui/SlidingPanel.qml +++ b/containments/panel/contents/ui/SlidingPanel.qml @@ -90,7 +90,8 @@ FullScreenPanel { } onPositionChanged: { if (startMouseY < contentArea.height - units.iconSizes.large) { - return; + //TODO: test if we can do without this return + // return; } var factor = (mouse.y - oldMouseY > 0) ? (1 - Math.max(0, (slidingArea.y + overShoot) / overShoot)) : 1 diff --git a/containments/panel/contents/ui/main.qml b/containments/panel/contents/ui/main.qml index e58d5f6e..1797685d 100644 --- a/containments/panel/contents/ui/main.qml +++ b/containments/panel/contents/ui/main.qml @@ -205,21 +205,32 @@ PlasmaCore.ColorScope { id: slidingPanel width: plasmoid.availableScreenRect.width height: plasmoid.availableScreenRect.height - contents: ColumnLayout { + contents: Item { id: panelContents anchors.fill: parent - Item { + Rectangle { id: quickSettingsParent + color: PlasmaCore.ColorScope.backgroundColor + z: 2 + anchors { + left: parent.left + top: parent.top + right: parent.right + } property var applet - Layout.fillWidth: true - Layout.minimumHeight: applet ? applet.fullRepresentationItem.Layout.minimumHeight : 0 + height: applet ? applet.fullRepresentationItem.Layout.minimumHeight : 0 } Item { id: notificationsParent + anchors { + left: parent.left + bottom: parent.bottom + right: parent.right + bottomMargin: root.height + } property var applet clip: true - Layout.minimumHeight: applet ? applet.Layout.minimumHeight : 0 - Layout.fillWidth: true + height: panelContents.height - quickSettingsParent.height-root.height//applet ? applet.Layout.minimumHeight : 0 } } } diff --git a/shell/contents/layout.js b/shell/contents/layout.js index e7c3c21c..fff9186e 100644 --- a/shell/contents/layout.js +++ b/shell/contents/layout.js @@ -13,6 +13,7 @@ desktopsArray[0].addWidget("org.kde.plasma.analogclock"); var panel = new Panel("org.kde.phone.panel"); panel.addWidget("org.kde.plasma.notifications"); +panel.addWidget("org.kde.phone.quicksettings"); panel.addWidget("org.kde.plasma.networkmanagement"); panel.addWidget("org.kde.plasma.battery"); panel.addWidget("org.kde.plasma.volume"); @@ -27,4 +28,6 @@ if (screenGeometry(bottomPanel.screen).height > screenGeometry(bottomPanel.scree else bottomPanel.height = 60; -createActivity("Activity 2"); +if (activities().length < 2) { + createActivity("Activity 2"); +}