mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Load minimized Quicksettings as Async
This commit is contained in:
parent
f9d4bd9a83
commit
6a869007fc
1 changed files with 33 additions and 22 deletions
|
|
@ -96,28 +96,12 @@ Item {
|
||||||
sourceModel: root.quickSettingsModel
|
sourceModel: root.quickSettingsModel
|
||||||
pageSize: Math.min(root.pageSize, root.minimizedColumns) // HACK: just root.minimizedColumns appears to end up with an empty model?
|
pageSize: Math.min(root.pageSize, root.minimizedColumns) // HACK: just root.minimizedColumns appears to end up with an empty model?
|
||||||
}
|
}
|
||||||
delegate: MobileShell.BaseItem {
|
delegate: Loader {
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
||||||
implicitHeight: root.minimizedRowHeight
|
asynchronous: true
|
||||||
implicitWidth: root.minimizedColumnWidth
|
|
||||||
horizontalPadding: (width - Kirigami.Units.gridUnit * 3) / 2
|
|
||||||
verticalPadding: (height - Kirigami.Units.gridUnit * 3) / 2
|
|
||||||
|
|
||||||
contentItem: QuickSettingsMinimizedDelegate {
|
sourceComponent: quickSettingComponentMinimized
|
||||||
restrictedPermissions: actionDrawer.restrictedPermissions
|
|
||||||
|
|
||||||
text: modelData.text
|
|
||||||
status: modelData.status
|
|
||||||
icon: modelData.icon
|
|
||||||
enabled: modelData.enabled
|
|
||||||
settingsCommand: modelData.settingsCommand
|
|
||||||
toggleFunction: modelData.toggle
|
|
||||||
|
|
||||||
onCloseRequested: {
|
|
||||||
actionDrawer.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -163,7 +147,7 @@ Item {
|
||||||
|
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
sourceComponent: quickSettingComponent
|
sourceComponent: quickSettingComponentFull
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -211,9 +195,36 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quick setting component
|
// Quick setting component minimized
|
||||||
Component {
|
Component {
|
||||||
id: quickSettingComponent
|
id: quickSettingComponentMinimized
|
||||||
|
|
||||||
|
MobileShell.BaseItem {
|
||||||
|
implicitHeight: root.minimizedRowHeight
|
||||||
|
implicitWidth: root.minimizedColumnWidth
|
||||||
|
horizontalPadding: (width - Kirigami.Units.gridUnit * 3) / 2
|
||||||
|
verticalPadding: (height - Kirigami.Units.gridUnit * 3) / 2
|
||||||
|
|
||||||
|
contentItem: QuickSettingsMinimizedDelegate {
|
||||||
|
restrictedPermissions: actionDrawer.restrictedPermissions
|
||||||
|
|
||||||
|
text: modelData.text
|
||||||
|
status: modelData.status
|
||||||
|
icon: modelData.icon
|
||||||
|
enabled: modelData.enabled
|
||||||
|
settingsCommand: modelData.settingsCommand
|
||||||
|
toggleFunction: modelData.toggle
|
||||||
|
|
||||||
|
onCloseRequested: {
|
||||||
|
actionDrawer.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Quick setting component full
|
||||||
|
Component {
|
||||||
|
id: quickSettingComponentFull
|
||||||
|
|
||||||
MobileShell.BaseItem {
|
MobileShell.BaseItem {
|
||||||
height: root.rowHeight
|
height: root.rowHeight
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue