mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
quicksettings: few corrections for landscape view
This commit is contained in:
parent
ab91a42e9e
commit
b429b9c34e
1 changed files with 10 additions and 12 deletions
|
|
@ -29,13 +29,11 @@ PlasmaCore.ColorScope {
|
||||||
readonly property real minimizedQuickSettingsOffset: height
|
readonly property real minimizedQuickSettingsOffset: height
|
||||||
readonly property real maximizedQuickSettingsOffset: height
|
readonly property real maximizedQuickSettingsOffset: height
|
||||||
readonly property bool isOnLargeScreen: width > quickSettings.width * 2.5
|
readonly property bool isOnLargeScreen: width > quickSettings.width * 2.5
|
||||||
|
readonly property real minWidthHeight: Math.min(root.width, root.height)
|
||||||
|
readonly property real opacityValue: Math.max(0, Math.min(1, actionDrawer.offset / root.minimizedQuickSettingsOffset))
|
||||||
|
|
||||||
colorGroup: PlasmaCore.Theme.ViewColorGroup
|
colorGroup: PlasmaCore.Theme.ViewColorGroup
|
||||||
|
|
||||||
function applyMinMax(val) {
|
|
||||||
return Math.max(0, Math.min(1, val));
|
|
||||||
}
|
|
||||||
|
|
||||||
// fullscreen background
|
// fullscreen background
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -45,7 +43,7 @@ PlasmaCore.ColorScope {
|
||||||
PlasmaCore.Theme.backgroundColor.b,
|
PlasmaCore.Theme.backgroundColor.b,
|
||||||
notificationWidget.hasNotifications ? 0.95 : 0.9)
|
notificationWidget.hasNotifications ? 0.95 : 0.9)
|
||||||
Behavior on color { ColorAnimation { duration: PlasmaCore.Units.longDuration } }
|
Behavior on color { ColorAnimation { duration: PlasmaCore.Units.longDuration } }
|
||||||
opacity: Math.max(0, Math.min(1, actionDrawer.offset / root.minimizedQuickSettingsOffset))
|
opacity: opacityValue
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.DataSource {
|
PlasmaCore.DataSource {
|
||||||
|
|
@ -65,16 +63,16 @@ PlasmaCore.ColorScope {
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: columnLayout
|
id: columnLayout
|
||||||
|
|
||||||
opacity: applyMinMax(root.actionDrawer.offset / root.maximizedQuickSettingsOffset)
|
opacity: opacityValue
|
||||||
spacing: 0
|
spacing: 0
|
||||||
anchors {
|
anchors {
|
||||||
top: mediaWidget.bottom
|
top: mediaWidget.bottom
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
bottomMargin: Math.min(root.width, root.height) * 0.06
|
bottomMargin: minWidthHeight * 0.06
|
||||||
right: quickSettings.left
|
right: quickSettings.left
|
||||||
rightMargin: Math.min(root.width, root.height) * 0.06
|
rightMargin: minWidthHeight * 0.06
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: Math.min(root.width, root.height) * 0.06
|
leftMargin: minWidthHeight * 0.06
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -101,7 +99,7 @@ PlasmaCore.ColorScope {
|
||||||
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 25
|
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 25
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: Math.min(root.width, root.height) * 0.02
|
Layout.topMargin: minWidthHeight * 0.02
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -118,7 +116,7 @@ PlasmaCore.ColorScope {
|
||||||
leftMargin: columnLayout.anchors.leftMargin
|
leftMargin: columnLayout.anchors.leftMargin
|
||||||
}
|
}
|
||||||
|
|
||||||
font.pixelSize: Math.min(40, Math.min(root.width, root.height) * 0.1)
|
font.pixelSize: Math.min(40, minWidthHeight * 0.1)
|
||||||
font.weight: Font.ExtraLight
|
font.weight: Font.ExtraLight
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
@ -138,7 +136,7 @@ PlasmaCore.ColorScope {
|
||||||
leftMargin: columnLayout.anchors.leftMargin
|
leftMargin: columnLayout.anchors.leftMargin
|
||||||
}
|
}
|
||||||
|
|
||||||
font.pixelSize: Math.min(20, Math.min(root.width, root.height) * 0.05)
|
font.pixelSize: Math.min(20, minWidthHeight * 0.05)
|
||||||
font.weight: Font.Light
|
font.weight: Font.Light
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue