Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85645640
D357.1787575316.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D357.1787575316.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D357: Fix configure shortcuts page show wrong section header text
Attached
Detach File
Event Timeline
Log In to Comment