better layout for quicksettings and notifications

This commit is contained in:
Marco Martin 2017-08-31 11:52:47 +02:00
parent 54d4d8dba9
commit f35d9909af
3 changed files with 23 additions and 8 deletions

View file

@ -90,7 +90,8 @@ FullScreenPanel {
} }
onPositionChanged: { onPositionChanged: {
if (startMouseY < contentArea.height - units.iconSizes.large) { 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 var factor = (mouse.y - oldMouseY > 0) ? (1 - Math.max(0, (slidingArea.y + overShoot) / overShoot)) : 1

View file

@ -205,21 +205,32 @@ PlasmaCore.ColorScope {
id: slidingPanel id: slidingPanel
width: plasmoid.availableScreenRect.width width: plasmoid.availableScreenRect.width
height: plasmoid.availableScreenRect.height height: plasmoid.availableScreenRect.height
contents: ColumnLayout { contents: Item {
id: panelContents id: panelContents
anchors.fill: parent anchors.fill: parent
Item { Rectangle {
id: quickSettingsParent id: quickSettingsParent
color: PlasmaCore.ColorScope.backgroundColor
z: 2
anchors {
left: parent.left
top: parent.top
right: parent.right
}
property var applet property var applet
Layout.fillWidth: true height: applet ? applet.fullRepresentationItem.Layout.minimumHeight : 0
Layout.minimumHeight: applet ? applet.fullRepresentationItem.Layout.minimumHeight : 0
} }
Item { Item {
id: notificationsParent id: notificationsParent
anchors {
left: parent.left
bottom: parent.bottom
right: parent.right
bottomMargin: root.height
}
property var applet property var applet
clip: true clip: true
Layout.minimumHeight: applet ? applet.Layout.minimumHeight : 0 height: panelContents.height - quickSettingsParent.height-root.height//applet ? applet.Layout.minimumHeight : 0
Layout.fillWidth: true
} }
} }
} }

View file

@ -13,6 +13,7 @@ desktopsArray[0].addWidget("org.kde.plasma.analogclock");
var panel = new Panel("org.kde.phone.panel"); var panel = new Panel("org.kde.phone.panel");
panel.addWidget("org.kde.plasma.notifications"); panel.addWidget("org.kde.plasma.notifications");
panel.addWidget("org.kde.phone.quicksettings");
panel.addWidget("org.kde.plasma.networkmanagement"); panel.addWidget("org.kde.plasma.networkmanagement");
panel.addWidget("org.kde.plasma.battery"); panel.addWidget("org.kde.plasma.battery");
panel.addWidget("org.kde.plasma.volume"); panel.addWidget("org.kde.plasma.volume");
@ -27,4 +28,6 @@ if (screenGeometry(bottomPanel.screen).height > screenGeometry(bottomPanel.scree
else else
bottomPanel.height = 60; bottomPanel.height = 60;
if (activities().length < 2) {
createActivity("Activity 2"); createActivity("Activity 2");
}