Custom buttons: improved UI, still wip
This commit is contained in:
parent
7f34ca4122
commit
598bc48957
3 changed files with 279 additions and 48 deletions
|
|
@ -165,6 +165,7 @@ ColumnLayout {
|
|||
onAddWidget: (widgetId, section) => addWidgetToSection(widgetId, section)
|
||||
onRemoveWidget: (section, index) => removeWidgetFromSection(section, index)
|
||||
onReorderWidget: (section, fromIndex, toIndex) => reorderWidgetInSection(section, fromIndex, toIndex)
|
||||
onUpdateWidgetSettings: (section, index, settings) => updateWidgetSettingsInSection(section, index, settings)
|
||||
}
|
||||
|
||||
// Center Section
|
||||
|
|
@ -176,6 +177,7 @@ ColumnLayout {
|
|||
onAddWidget: (widgetId, section) => addWidgetToSection(widgetId, section)
|
||||
onRemoveWidget: (section, index) => removeWidgetFromSection(section, index)
|
||||
onReorderWidget: (section, fromIndex, toIndex) => reorderWidgetInSection(section, fromIndex, toIndex)
|
||||
onUpdateWidgetSettings: (section, index, settings) => updateWidgetSettingsInSection(section, index, settings)
|
||||
}
|
||||
|
||||
// Right Section
|
||||
|
|
@ -187,6 +189,7 @@ ColumnLayout {
|
|||
onAddWidget: (widgetId, section) => addWidgetToSection(widgetId, section)
|
||||
onRemoveWidget: (section, index) => removeWidgetFromSection(section, index)
|
||||
onReorderWidget: (section, fromIndex, toIndex) => reorderWidgetInSection(section, fromIndex, toIndex)
|
||||
onUpdateWidgetSettings: (section, index, settings) => updateWidgetSettingsInSection(section, index, settings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -197,6 +200,12 @@ ColumnLayout {
|
|||
Layout.bottomMargin: Style.marginXL * scaling
|
||||
}
|
||||
|
||||
function updateWidgetSettingsInSection(section, index, settings) {
|
||||
// Update the widget settings in the Settings data
|
||||
Settings.data.bar.widgets[section][index] = settings
|
||||
Logger.log("BarTab", `Updated widget settings for ${settings.id} in ${section} section`)
|
||||
}
|
||||
|
||||
// Helper functions
|
||||
function addWidgetToSection(widgetId, section) {
|
||||
//Logger.log("BarTab", "Adding widget", widgetId, "to section", section)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue