diff --git a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml index e03f5d5f..cb07b95f 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml @@ -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 diff --git a/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml b/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml index a2666e60..059b9653 100644 --- a/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml +++ b/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml @@ -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