mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Folio: Make SettingsComponent Buttons Match FavoritesBar Location
This merge request makes the SettingsComponent buttons match the FavoritesBar location. This helps better utilize the available screen space as before the buttons would exclusively remain at the bottom and could cause them to overlap with the HomeScreenPage or navbar. Before:  After: 
This commit is contained in:
parent
a452bc3030
commit
06e5a89ca7
2 changed files with 81 additions and 12 deletions
|
|
@ -148,6 +148,10 @@ Item {
|
|||
opacity: folio.HomeScreenState.settingsOpenProgress
|
||||
z: 1
|
||||
|
||||
bottomMargin: root.bottomMargin
|
||||
leftMargin: root.leftMargin
|
||||
rightMargin: root.rightMargin
|
||||
|
||||
// move the settings out of the way if it is not visible
|
||||
// NOTE: we do this instead of setting visible to false, because
|
||||
// it doesn't mess with widget drag and drop
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ Item {
|
|||
|
||||
readonly property bool homeScreenInteractive: !appletListViewer.open
|
||||
|
||||
property real bottomMargin: 0
|
||||
property real leftMargin: 0
|
||||
property real rightMargin: 0
|
||||
|
||||
Connections {
|
||||
target: folio.HomeScreenState
|
||||
|
||||
|
|
@ -37,11 +41,6 @@ Item {
|
|||
MouseArea {
|
||||
id: closeSettings
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: settingsBar.top
|
||||
|
||||
onClicked: {
|
||||
folio.HomeScreenState.closeSettingsView();
|
||||
}
|
||||
|
|
@ -53,16 +52,15 @@ Item {
|
|||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: Kirigami.Units.largeSpacing
|
||||
height: root.height * (1 - settingsModeHomeScreenScale)
|
||||
anchors.bottomMargin: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Bottom ? Kirigami.Units.largeSpacing + Math.round(root.bottomMargin / 2) : 0
|
||||
anchors.rightMargin: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Right ? Kirigami.Units.largeSpacing + Math.round(root.rightMargin / 2) : 0
|
||||
anchors.leftMargin: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Left ? Kirigami.Units.largeSpacing + Math.round(root.leftMargin / 2) : 0
|
||||
|
||||
RowLayout {
|
||||
GridLayout {
|
||||
id: settingsOptions
|
||||
flow: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Bottom ? GridLayout.LeftToRight : GridLayout.TopToBottom
|
||||
|
||||
anchors.centerIn: parent
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
PC3.ToolButton {
|
||||
opacity: 0.9
|
||||
|
|
@ -150,6 +148,73 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "bottom"
|
||||
when: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Bottom
|
||||
PropertyChanges {
|
||||
target: settingsBar
|
||||
height: root.height * (1 - root.settingsModeHomeScreenScale)
|
||||
}
|
||||
AnchorChanges {
|
||||
target: settingsBar
|
||||
anchors.top: undefined
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
}
|
||||
AnchorChanges {
|
||||
target: closeSettings
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: settingsBar.top
|
||||
}
|
||||
}, State {
|
||||
name: "left"
|
||||
when: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Left
|
||||
PropertyChanges {
|
||||
target: settingsBar
|
||||
width: root.width * (1 - root.settingsModeHomeScreenScale)
|
||||
}
|
||||
AnchorChanges {
|
||||
target: settingsBar
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: undefined
|
||||
}
|
||||
AnchorChanges {
|
||||
target: closeSettings
|
||||
anchors.top: parent.top
|
||||
anchors.left: settingsBar.right
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
}
|
||||
}, State {
|
||||
name: "right"
|
||||
when: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Right
|
||||
PropertyChanges {
|
||||
target: settingsBar
|
||||
width: root.width * (1 - root.settingsModeHomeScreenScale)
|
||||
}
|
||||
AnchorChanges {
|
||||
target: settingsBar
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: undefined
|
||||
anchors.right: parent.right
|
||||
}
|
||||
AnchorChanges {
|
||||
target: closeSettings
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: settingsBar.left
|
||||
anchors.bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
AppletListViewer {
|
||||
id: appletListViewer
|
||||
folio: root.folio
|
||||
|
|
|
|||
Loading…
Reference in a new issue