1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 14:32:52 -05:00

settings: add index extractor script for search

This commit is contained in:
bbedward
2025-12-26 22:21:20 -05:00
parent 6611dfbe05
commit 9fc0d5efff
13 changed files with 4361 additions and 580 deletions

View File

@@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
import QtQuick
import qs.Common
import qs.Services
import qs.Widgets
Item {
@@ -16,6 +17,46 @@ Item {
property string text: ""
property string description: ""
readonly property bool isHighlighted: settingKey !== "" && SettingsSearchService.highlightSection === settingKey
function findParentFlickable() {
let p = root.parent;
while (p) {
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
return p;
p = p.parent;
}
return null;
}
Component.onCompleted: {
if (!settingKey)
return;
let flickable = findParentFlickable();
if (flickable)
SettingsSearchService.registerCard(settingKey, root, flickable);
}
Component.onDestruction: {
if (settingKey)
SettingsSearchService.unregisterCard(settingKey);
}
Rectangle {
anchors.fill: parent
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.primary, root.isHighlighted ? 0.2 : 0)
visible: root.isHighlighted
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
property alias model: buttonGroup.model
property alias currentIndex: buttonGroup.currentIndex
property alias selectionMode: buttonGroup.selectionMode