Page MenuHomePhorge

D357.1787575316.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D357.1787575316.diff

diff --git a/src/contents/ui/shortcuts/ActionSettings.qml b/src/contents/ui/shortcuts/ActionSettings.qml
--- a/src/contents/ui/shortcuts/ActionSettings.qml
+++ b/src/contents/ui/shortcuts/ActionSettings.qml
@@ -20,19 +20,42 @@
/// }
property var shortcutsConfig
- model: actionsGrouped
+ readonly property var displayModel: {
+ const res = [];
+ let prevGroup;
+ for (const entry of actionsGrouped) {
+ if (entry.group !== prevGroup) {
+ res.push({ isHeader: true, name: entry.group });
+ prevGroup = entry.group;
+ }
+ res.push({ isHeader: false, action: entry.action });
+ }
+ return res;
+ }
- delegate: KazvShortcuts.ActionItem {
+ model: displayModel
+
+ delegate: Loader {
+ id: actionDelegate
+ required property var modelData
width: actionSettings.width
- action: actions[index]
- }
+ sourceComponent: modelData.isHeader ? headerComponent : actionComponent
- section.property: 'group'
- section.delegate: Kirigami.ListSectionHeader {
- width: ListView.view.width
+ Component {
+ id: headerComponent
+ Kirigami.ListSectionHeader {
+ width: actionDelegate.width
+ text: actionDelegate.modelData.name
+ }
+ }
- required property string section
- label: section
+ Component {
+ id: actionComponent
+ KazvShortcuts.ActionItem {
+ width: actionDelegate.width
+ action: actionDelegate.modelData.action
+ }
+ }
}
function shortcutToSequence(str) {

File Metadata

Mime Type
text/plain
Expires
Mon, Aug 24, 5:41 AM (23 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1734664
Default Alt Text
D357.1787575316.diff (1 KB)

Event Timeline