mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Custom buttons: improved UI, still wip
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user