From 889c085c211d900118890c8274600a124a0c46f7 Mon Sep 17 00:00:00 2001 From: User8395 Date: Fri, 25 Oct 2024 17:02:30 +0000 Subject: [PATCH] quicksettings: fix landscape not being scrollable Currently, Quick Settings in landscape mode is not scrollable, due to issues with `scrollViewComponent`. This causes some buttons to become unseen in landscape mode but not portrait. This has been solved by deleting `scrollViewComponent` and replacing it with `swipeViewComponent`, to allow swiping to access other buttons in Quick Settings. Before (docked mode and hotspot are missing): ![screen-recording__1_](/uploads/e0c4eaf22a2ec401c66e9e513e8ce7e1/screen-recording__1_.webm) After (docked mode and hotspot are there): ![screen-recording](/uploads/404ebbecc87e1b60b2501b81b8ab83ee/screen-recording.webm) However, with this setup, `resetSwipeView()` doesn't work, and Quick Settings remains at the page it was left at. --- .../quicksettings/QuickSettings.qml | 62 +------------------ 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml index 64a2b9ac..0f8dc95c 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml @@ -103,7 +103,7 @@ Item { Layout.minimumHeight: rowCount * rowHeight asynchronous: true - sourceComponent: root.mode === QuickSettings.Pages ? swipeViewComponent : scrollViewComponent + sourceComponent: swipeViewComponent } BrightnessItem { @@ -157,7 +157,7 @@ Item { } } - // Loads portrait quick settings view + // Loads portrait and landscape quick settings view Component { id: swipeViewComponent @@ -228,64 +228,6 @@ Item { } } - // Loads landscape quick settings view - Component { - id: scrollViewComponent - - Item { - width: parent.width - height: rowCount * rowHeight - - Flickable { - id: flickable - anchors.fill: parent - contentWidth: width - contentHeight: flow.height - - clip: true - - ScrollIndicator.vertical: ScrollIndicator { - id: scrollIndicator - visible: quickSettingsCount > pageSize ? true : false - position: 0.1 - - contentItem: Item { - implicitWidth: Kirigami.Units.smallSpacing / 4 - Rectangle { - // shift over the indicator a bit to the right - anchors.fill: parent - anchors.leftMargin: 2 - anchors.rightMargin: -2 - - color: Kirigami.Theme.textColor - opacity: scrollIndicator.active ? 0.5 : 0 - - Behavior on opacity { NumberAnimation {} } - } - } - } - - Flow { - id: flow - width: parent.width - height: Math.ceil(quickSettingsCount / columnCount) * rowHeight - spacing: 0 - - Repeater { - model: quickSettingsModel - delegate: Loader { - required property var modelData - - asynchronous: true - - sourceComponent: quickSettingComponent - } - } - } - } - } - } - // Quick setting component Component { id: quickSettingComponent