mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
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):  After (docked mode and hotspot are there):  However, with this setup, `resetSwipeView()` doesn't work, and Quick Settings remains at the page it was left at.
This commit is contained in:
parent
681d1683f5
commit
889c085c21
1 changed files with 2 additions and 60 deletions
|
|
@ -103,7 +103,7 @@ Item {
|
||||||
Layout.minimumHeight: rowCount * rowHeight
|
Layout.minimumHeight: rowCount * rowHeight
|
||||||
|
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
sourceComponent: root.mode === QuickSettings.Pages ? swipeViewComponent : scrollViewComponent
|
sourceComponent: swipeViewComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
BrightnessItem {
|
BrightnessItem {
|
||||||
|
|
@ -157,7 +157,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loads portrait quick settings view
|
// Loads portrait and landscape quick settings view
|
||||||
Component {
|
Component {
|
||||||
id: swipeViewComponent
|
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
|
// Quick setting component
|
||||||
Component {
|
Component {
|
||||||
id: quickSettingComponent
|
id: quickSettingComponent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue