Skip to content

Commit

Permalink
refactor: use the same settings component for overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
luisbocanegra committed Sep 23, 2024
1 parent 6a2ede1 commit 4f23428
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 282 deletions.
278 changes: 0 additions & 278 deletions package/contents/ui/components/FormPerWidgetSettings.qml

This file was deleted.

8 changes: 6 additions & 2 deletions package/contents/ui/components/FormWidgetSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ColumnLayout {
// internal config objects to be sent, both string and json
property string configString: "{}"
property var config: handleString ? JSON.parse(configString) : undefined
property var configLocal: config[keyName]
property var configLocal: keyName ? config[keyName] : config
signal updateConfigString(configString: string, config: var)
// whether the current item supports foreground customization, e.g the panel does not
property bool supportsForeground: true
Expand All @@ -40,7 +40,11 @@ ColumnLayout {
}

function updateConfig() {
config[keyName] = configLocal
if (keyName) {
config[keyName] = configLocal
} else {
config = configLocal
}
configString = JSON.stringify(config, null, null)
// console.error(configString)
updateConfigString(configString, config)
Expand Down
3 changes: 1 addition & 2 deletions package/contents/ui/configPerWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,9 @@ KCM.SimpleKCM {

Component {
id: settingsComp
Components.FormPerWidgetSettings {
Components.FormWidgetSettings {
currentTab: 0
handleString: false
keyName: "configuration"
}
}
}
Expand Down

0 comments on commit 4f23428

Please sign in to comment.