mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
better layout in widescreen mode
This commit is contained in:
parent
5be8125c62
commit
b675eeb635
3 changed files with 16 additions and 20 deletions
|
|
@ -30,8 +30,8 @@ NanoShell.FullScreenOverlay {
|
||||||
property int offset: 0
|
property int offset: 0
|
||||||
property int openThreshold
|
property int openThreshold
|
||||||
property bool userInteracting: false
|
property bool userInteracting: false
|
||||||
readonly property bool wideScreen: width > units.gridUnit * 45
|
readonly property bool wideScreen: width > height || width > units.gridUnit * 45
|
||||||
readonly property int drawerWidth: wideScreen ? units.gridUnit * 25 : width
|
readonly property int drawerWidth: wideScreen ? contentItem.implicitWidth : width
|
||||||
property int drawerX: 0
|
property int drawerX: 0
|
||||||
property alias fixedArea: mainScope
|
property alias fixedArea: mainScope
|
||||||
property alias flickable: mainFlickable
|
property alias flickable: mainFlickable
|
||||||
|
|
|
||||||
|
|
@ -280,15 +280,19 @@ Item {
|
||||||
|
|
||||||
onClosed: quickSettings.closed()
|
onClosed: quickSettings.closed()
|
||||||
|
|
||||||
contentItem: Item {
|
contentItem: GridLayout {
|
||||||
id: panelContents
|
id: panelContents
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
implicitWidth: quickSettingsParent.implicitWidth
|
implicitWidth: quickSettingsParent.implicitWidth
|
||||||
implicitHeight: quickSettingsParent.implicitHeight
|
implicitHeight: MAth.min(slidingPanel.height, quickSettingsParent.implicitHeight)
|
||||||
|
|
||||||
|
columns: slidingPanel.wideScreen ? 2 : 1
|
||||||
|
rows: slidingPanel.wideScreen ? 1 : 2
|
||||||
DrawerBackground {
|
DrawerBackground {
|
||||||
id: quickSettingsParent
|
id: quickSettingsParent
|
||||||
anchors.fill: parent
|
//anchors.fill: parent
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
Layout.preferredWidth: slidingPanel.wideScreen ? Math.min(slidingPanel.width/2, units.gridUnit * 25) : panelContents.width
|
||||||
z: 4
|
z: 4
|
||||||
contentItem: QuickSettings {
|
contentItem: QuickSettings {
|
||||||
id: quickSettings
|
id: quickSettings
|
||||||
|
|
@ -302,15 +306,14 @@ Item {
|
||||||
ListView {
|
ListView {
|
||||||
id: fullRepresentationView
|
id: fullRepresentationView
|
||||||
z: 1
|
z: 1
|
||||||
parent: slidingPanel.wideScreen ? slidingPanel.flickable.contentItem : panelContents
|
//parent: slidingPanel.wideScreen ? slidingPanel.flickable.contentItem : panelContents
|
||||||
anchors {
|
Layout.preferredWidth: slidingPanel.wideScreen ? Math.min(slidingPanel.width/2, quickSettingsParent.width*fullRepresentationModel.count) : panelContents.width
|
||||||
left: parent.left
|
//Layout.fillWidth: true
|
||||||
right: parent.right
|
clip: slidingPanel.wideScreen
|
||||||
}
|
y: slidingPanel.wideScreen ? 0 : quickSettingsParent.height - height * (1-opacity)
|
||||||
y: quickSettingsParent.height - height * (1-opacity)
|
opacity: slidingPanel.wideScreen ? 1 : fullRepresentationModel.count > 0 && slidingPanel.offset/panelContents.height
|
||||||
opacity: fullRepresentationModel.count > 0 && slidingPanel.offset/panelContents.height
|
|
||||||
height: Math.min(plasmoid.screenGeometry.height - slidingPanel.headerHeight - quickSettingsParent.height - bottomBar.height, implicitHeight)
|
height: Math.min(plasmoid.screenGeometry.height - slidingPanel.headerHeight - quickSettingsParent.height - bottomBar.height, implicitHeight)
|
||||||
leftMargin: slidingPanel.drawerX
|
//leftMargin: slidingPanel.drawerX
|
||||||
preferredHighlightBegin: slidingPanel.drawerX
|
preferredHighlightBegin: slidingPanel.drawerX
|
||||||
|
|
||||||
implicitHeight: units.gridUnit * 20
|
implicitHeight: units.gridUnit * 20
|
||||||
|
|
|
||||||
|
|
@ -251,13 +251,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
move: Transition {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: units.shortDuration
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
properties: "x,y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BrightnessItem {
|
BrightnessItem {
|
||||||
id: brightnessSlider
|
id: brightnessSlider
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue