Settings: re-organization

This commit is contained in:
ItsLemmy
2025-10-12 22:09:35 -04:00
parent 565671c625
commit e3f0f428da
25 changed files with 808 additions and 1058 deletions
+100 -51
View File
@@ -27,34 +27,45 @@ ColumnLayout {
}
}
// Quick Settings Style Section
ColumnLayout {
spacing: Style.marginL
Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.control-center.quickSettingsStyle.section.label")
description: I18n.tr("settings.control-center.quickSettingsStyle.section.description")
label: I18n.tr("settings.control-center.section.label")
description: I18n.tr("settings.control-center.section.description")
}
NComboBox {
id: quickSettingsStyle
label: I18n.tr("settings.control-center.quickSettingsStyle.style.label")
description: I18n.tr("settings.control-center.quickSettingsStyle.style.description")
id: controlCenterPosition
label: I18n.tr("settings.control-center.position.label")
description: I18n.tr("settings.control-center.position.description")
Layout.fillWidth: true
model: [{
"key": "compact",
"name": I18n.tr("options.control-center.quickSettingsStyle.compact")
"key": "close_to_bar_button",
"name": I18n.tr("options.control-center.position.close_to_bar_button")
}, {
"key": "classic",
"name": I18n.tr("options.control-center.quickSettingsStyle.classic")
"key": "top_left",
"name": I18n.tr("options.control-center.position.top_left")
}, {
"key": "modern",
"name": I18n.tr("options.control-center.quickSettingsStyle.modern")
"key": "top_right",
"name": I18n.tr("options.control-center.position.top_right")
}, {
"key": "bottom_left",
"name": I18n.tr("options.control-center.position.bottom_left")
}, {
"key": "bottom_right",
"name": I18n.tr("options.control-center.position.bottom_right")
}, {
"key": "bottom_center",
"name": I18n.tr("options.control-center.position.bottom_center")
}, {
"key": "top_center",
"name": I18n.tr("options.control-center.position.top_center")
}]
currentKey: Settings.data.controlCenter.quickSettingsStyle || "compact"
currentKey: Settings.data.controlCenter.position
onSelected: function (key) {
Settings.data.controlCenter.quickSettingsStyle = key
Settings.data.controlCenter.position = key
}
}
}
@@ -65,47 +76,85 @@ ColumnLayout {
Layout.bottomMargin: Style.marginXL
}
// Widgets Management Section
ColumnLayout {
spacing: Style.marginXXS
Layout.fillWidth: true
// // Quick Settings Style Section
// ColumnLayout {
// spacing: Style.marginL
// Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.control-center.widgets.section.label")
description: I18n.tr("settings.control-center.widgets.section.description")
}
// NHeader {
// label: I18n.tr("settings.control-center.quickSettingsStyle.section.label")
// description: I18n.tr("settings.control-center.quickSettingsStyle.section.description")
// }
// Bar Sections
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: Style.marginM
spacing: Style.marginM
// NComboBox {
// id: quickSettingsStyle
// label: I18n.tr("settings.control-center.quickSettingsStyle.style.label")
// description: I18n.tr("settings.control-center.quickSettingsStyle.style.description")
// Layout.fillWidth: true
// model: [{
// "key": "compact",
// "name": I18n.tr("options.control-center.quickSettingsStyle.compact")
// }, {
// "key": "classic",
// "name": I18n.tr("options.control-center.quickSettingsStyle.classic")
// }, {
// "key": "modern",
// "name": I18n.tr("options.control-center.quickSettingsStyle.modern")
// }]
// currentKey: Settings.data.controlCenter.quickSettingsStyle || "compact"
// onSelected: function (key) {
// Settings.data.controlCenter.quickSettingsStyle = key
// }
// }
// }
// Quick Settings
SectionEditor {
sectionName: I18n.tr("settings.control-center.quickSettings.sectionName")
sectionId: "quickSettings"
settingsDialogComponent: ""
widgetRegistry: ControlCenterWidgetRegistry
widgetModel: Settings.data.controlCenter.widgets["quickSettings"]
availableWidgets: availableWidgets
enableMoveBetweenSections: false
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)
onDragPotentialStarted: root.handleDragStart()
onDragPotentialEnded: root.handleDragEnd()
}
}
}
// NDivider {
// Layout.fillWidth: true
// Layout.topMargin: Style.marginXL
// Layout.bottomMargin: Style.marginXL
// }
NDivider {
Layout.fillWidth: true
Layout.topMargin: Style.marginXL
Layout.bottomMargin: Style.marginXL
}
// // Widgets Management Section
// ColumnLayout {
// spacing: Style.marginXXS
// Layout.fillWidth: true
// NHeader {
// label: I18n.tr("settings.control-center.widgets.section.label")
// description: I18n.tr("settings.control-center.widgets.section.description")
// }
// // Bar Sections
// ColumnLayout {
// Layout.fillWidth: true
// Layout.fillHeight: true
// Layout.topMargin: Style.marginM
// spacing: Style.marginM
// // Quick Settings
// SectionEditor {
// sectionName: I18n.tr("settings.control-center.quickSettings.sectionName")
// sectionId: "quickSettings"
// settingsDialogComponent: ""
// widgetRegistry: ControlCenterWidgetRegistry
// widgetModel: Settings.data.controlCenter.widgets["quickSettings"]
// availableWidgets: availableWidgets
// enableMoveBetweenSections: false
// 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)
// onDragPotentialStarted: root.handleDragStart()
// onDragPotentialEnded: root.handleDragEnd()
// }
// }
// }
// NDivider {
// Layout.fillWidth: true
// Layout.topMargin: Style.marginXL
// Layout.bottomMargin: Style.marginXL
// }
// ---------------------------------
// Signal functions