1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 22:15:38 -05:00

Add "daemon" type of plugins

This commit is contained in:
bbedward
2025-10-03 22:55:07 -04:00
parent c3d505cdad
commit 0d5c1bb3df
8 changed files with 250 additions and 17 deletions

View File

@@ -15,14 +15,25 @@ Column {
width: parent.width
spacing: Theme.spacingS
Component.onCompleted: {
function loadValue() {
const settings = findSettings()
if (settings) {
if (settings && settings.pluginService) {
value = settings.loadValue(settingKey, defaultValue)
textField.text = value
}
}
Component.onCompleted: {
loadValue()
}
onValueChanged: {
const settings = findSettings()
if (settings) {
settings.saveValue(settingKey, value)
}
}
function findSettings() {
let item = parent
while (item) {
@@ -54,11 +65,15 @@ Column {
id: textField
width: parent.width
placeholderText: root.placeholder
onTextEdited: {
root.value = text
}
onEditingFinished: {
root.value = text
const settings = findSettings()
if (settings) {
settings.saveValue(settingKey, text)
}
onActiveFocusChanged: {
if (!activeFocus) {
root.value = text
}
}
}