Settings: more subtabs work

This commit is contained in:
Lemmy
2026-01-05 18:27:15 -05:00
parent 5232cd9311
commit f64986e7a5
19 changed files with 171 additions and 222 deletions
+2 -2
View File
@@ -1444,7 +1444,7 @@
"tabs": {
"appearance": "Appearance",
"cards": "Cards",
"control-widgets": "Control Widgets"
"shortcuts": "Shortcuts"
},
"title": "Control Center"
},
@@ -2749,7 +2749,7 @@
"tabs": {
"automation": "Automation",
"look-feel": "Look & feel",
"settings": "Settings"
"general": "General"
},
"title": "Wallpaper"
}
@@ -7,6 +7,7 @@ import qs.Modules.Panels.Settings.Tabs
import qs.Modules.Panels.Settings.Tabs.Audio
import qs.Modules.Panels.Settings.Tabs.Bar
import qs.Modules.Panels.Settings.Tabs.ColorScheme
import qs.Modules.Panels.Settings.Tabs.ControlCenter
import qs.Modules.Panels.Settings.Tabs.Display
import qs.Modules.Panels.Settings.Tabs.Dock
import qs.Modules.Panels.Settings.Tabs.Notifications
@@ -9,11 +9,6 @@ ColumnLayout {
spacing: Style.marginL
Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.bar.appearance.section.label")
description: I18n.tr("settings.bar.appearance.section.description")
}
NComboBox {
Layout.fillWidth: true
label: I18n.tr("settings.bar.appearance.position.label")
@@ -14,11 +14,6 @@ ColumnLayout {
property var addMonitor
property var removeMonitor
NHeader {
label: I18n.tr("settings.bar.monitors.section.label")
description: I18n.tr("settings.bar.monitors.section.description")
}
Repeater {
model: Quickshell.screens || []
delegate: NCheckbox {
@@ -43,4 +38,8 @@ ColumnLayout {
}
}
}
NLabel {
description: I18n.tr("settings.bar.monitors.section.description")
}
}
@@ -20,14 +20,6 @@ ColumnLayout {
signal openPluginSettings(var manifest)
NHeader {
label: I18n.tr("settings.bar.widgets.section.label")
}
NLabel {
description: I18n.tr("settings.bar.widgets.section.description")
}
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
@@ -81,5 +73,9 @@ ColumnLayout {
onMoveWidget: (fromSection, index, toSection) => root.moveWidgetBetweenSections(fromSection, index, toSection)
onOpenPluginSettingsRequested: manifest => root.openPluginSettings(manifest)
}
NLabel {
description: I18n.tr("settings.bar.widgets.section.description")
}
}
}
@@ -17,11 +17,6 @@ ColumnLayout {
spacing: Style.marginL
Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.control-center.section.label")
description: I18n.tr("settings.control-center.section.description")
}
NComboBox {
id: controlCenterPosition
label: I18n.tr("settings.control-center.position.label")
@@ -31,11 +31,6 @@ ColumnLayout {
spacing: Style.marginXXS
Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.control-center.cards.section.label")
description: I18n.tr("settings.control-center.cards.section.description")
}
Connections {
target: Settings.data.location
function onWeatherEnabledChanged() {
@@ -76,7 +71,7 @@ ColumnLayout {
}
}
Rectangle {
Layout.fillHeight: true
NLabel {
description: I18n.tr("settings.control-center.cards.section.description")
}
}
@@ -120,7 +120,7 @@ ColumnLayout {
checked: subTabBar.currentIndex === 1
}
NTabButton {
text: I18n.tr("settings.control-center.tabs.control-widgets")
text: I18n.tr("settings.control-center.tabs.shortcuts")
tabIndex: 2
checked: subTabBar.currentIndex === 2
}
@@ -144,7 +144,7 @@ ColumnLayout {
cardsDefault: root.cardsDefault
}
ControlWidgetsSubTab {
ShortcutsSubTab {
availableWidgets: availableWidgets
onAddWidgetToSection: (widgetId, section) => _addWidgetToSection(widgetId, section)
onRemoveWidgetFromSection: (section, index) => _removeWidgetFromSection(section, index)
@@ -27,11 +27,6 @@ ColumnLayout {
spacing: Style.marginXXS
Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.control-center.shortcuts.section.label")
description: I18n.tr("settings.control-center.shortcuts.section.description")
}
// Sections
ColumnLayout {
Layout.fillWidth: true
@@ -27,11 +27,6 @@ ColumnLayout {
}
}
NHeader {
label: I18n.tr("settings.desktop-widgets.general.section.label")
description: I18n.tr("settings.desktop-widgets.general.section.description")
}
NToggle {
Layout.fillWidth: true
label: I18n.tr("settings.desktop-widgets.enabled.label")
@@ -9,11 +9,6 @@ ColumnLayout {
spacing: Style.marginL
Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.dock.appearance.section.label")
description: I18n.tr("settings.dock.appearance.section.description")
}
NToggle {
Layout.fillWidth: true
label: I18n.tr("settings.dock.enabled.label")
@@ -24,8 +19,11 @@ ColumnLayout {
onToggled: checked => Settings.data.dock.enabled = checked
}
NComboBox {
ColumnLayout {
spacing: Style.marginL
visible: Settings.data.dock.enabled
NComboBox {
Layout.fillWidth: true
label: I18n.tr("settings.dock.appearance.display.label")
description: I18n.tr("settings.dock.appearance.display.description")
@@ -52,7 +50,6 @@ ColumnLayout {
}
NValueSlider {
visible: Settings.data.dock.enabled
Layout.fillWidth: true
label: I18n.tr("settings.dock.appearance.background-opacity.label")
description: I18n.tr("settings.dock.appearance.background-opacity.description")
@@ -67,7 +64,6 @@ ColumnLayout {
}
NValueSlider {
visible: Settings.data.dock.enabled
Layout.fillWidth: true
label: I18n.tr("settings.dock.appearance.dead-opacity.label")
description: I18n.tr("settings.dock.appearance.dead-opacity.description")
@@ -82,7 +78,6 @@ ColumnLayout {
}
NValueSlider {
visible: Settings.data.dock.enabled
Layout.fillWidth: true
label: I18n.tr("settings.dock.appearance.floating-distance.label")
description: I18n.tr("settings.dock.appearance.floating-distance.description")
@@ -97,7 +92,6 @@ ColumnLayout {
}
NValueSlider {
visible: Settings.data.dock.enabled
Layout.fillWidth: true
label: I18n.tr("settings.dock.appearance.icon-size.label")
description: I18n.tr("settings.dock.appearance.icon-size.description")
@@ -112,7 +106,7 @@ ColumnLayout {
}
NValueSlider {
visible: Settings.data.dock.enabled && Settings.data.dock.displayMode === "auto_hide"
visible: Settings.data.dock.displayMode === "auto_hide"
Layout.fillWidth: true
label: I18n.tr("settings.dock.appearance.hide-show-speed.label")
description: I18n.tr("settings.dock.appearance.hide-show-speed.description")
@@ -127,7 +121,6 @@ ColumnLayout {
}
NToggle {
visible: Settings.data.dock.enabled
label: I18n.tr("settings.dock.appearance.inactive-indicators.label")
description: I18n.tr("settings.dock.appearance.inactive-indicators.description")
checked: Settings.data.dock.inactiveIndicators
@@ -137,7 +130,6 @@ ColumnLayout {
}
NToggle {
visible: Settings.data.dock.enabled
label: I18n.tr("settings.dock.appearance.pinned-static.label")
description: I18n.tr("settings.dock.appearance.pinned-static.description")
checked: Settings.data.dock.pinnedStatic
@@ -147,7 +139,6 @@ ColumnLayout {
}
NToggle {
visible: Settings.data.dock.enabled
label: I18n.tr("settings.dock.monitors.only-same-monitor.label")
description: I18n.tr("settings.dock.monitors.only-same-monitor.description")
checked: Settings.data.dock.onlySameOutput
@@ -157,7 +148,6 @@ ColumnLayout {
}
NToggle {
visible: Settings.data.dock.enabled
Layout.fillWidth: true
label: I18n.tr("settings.dock.appearance.colorize-icons.label")
description: I18n.tr("settings.dock.appearance.colorize-icons.description")
@@ -166,4 +156,5 @@ ColumnLayout {
defaultValue: Settings.getDefaultValue("dock.colorizeIcons")
onToggled: checked => Settings.data.dock.colorizeIcons = checked
}
}
}
+2 -17
View File
@@ -8,19 +8,6 @@ ColumnLayout {
id: root
spacing: 0
// Helper functions to update arrays immutably
function addMonitor(list, name) {
const arr = (list || []).slice();
if (!arr.includes(name))
arr.push(name);
return arr;
}
function removeMonitor(list, name) {
return (list || []).filter(function (n) {
return n !== name;
});
}
NTabBar {
id: subTabBar
Layout.fillWidth: true
@@ -36,6 +23,7 @@ ColumnLayout {
text: I18n.tr("settings.dock.tabs.monitors")
tabIndex: 1
checked: subTabBar.currentIndex === 1
visible: Settings.data.dock.enabled
}
}
@@ -49,9 +37,6 @@ ColumnLayout {
currentIndex: subTabBar.currentIndex
AppearanceSubTab {}
MonitorsSubTab {
addMonitor: root.addMonitor
removeMonitor: root.removeMonitor
}
MonitorsSubTab {}
}
}
@@ -11,12 +11,17 @@ ColumnLayout {
spacing: Style.marginL
Layout.fillWidth: true
property var addMonitor
property var removeMonitor
NHeader {
label: I18n.tr("settings.dock.monitors.section.label")
description: I18n.tr("settings.dock.monitors.section.description")
// Helper functions to update arrays immutably
function addMonitor(list, name) {
const arr = (list || []).slice();
if (!arr.includes(name))
arr.push(name);
return arr;
}
function removeMonitor(list, name) {
return (list || []).filter(function (n) {
return n !== name;
});
}
Repeater {
@@ -36,11 +41,15 @@ ColumnLayout {
checked: (Settings.data.dock.monitors || []).indexOf(modelData.name) !== -1
onToggled: checked => {
if (checked) {
Settings.data.dock.monitors = addMonitor(Settings.data.dock.monitors, modelData.name);
Settings.data.dock.monitors = root.addMonitor(Settings.data.dock.monitors, modelData.name);
} else {
Settings.data.dock.monitors = removeMonitor(Settings.data.dock.monitors, modelData.name);
Settings.data.dock.monitors = root.removeMonitor(Settings.data.dock.monitors, modelData.name);
}
}
}
}
NLabel {
description: I18n.tr("settings.dock.monitors.section.description")
}
}
@@ -10,10 +10,6 @@ ColumnLayout {
spacing: Style.marginL
Layout.fillWidth: true
NHeader {
label: I18n.tr("settings.wallpaper.automation.section.label")
}
NToggle {
label: I18n.tr("settings.wallpaper.automation.scheduled-change.label")
description: I18n.tr("settings.wallpaper.automation.scheduled-change.description")
@@ -17,11 +17,6 @@ ColumnLayout {
signal openMainFolderPicker
signal openMonitorFolderPicker(string monitorName)
NHeader {
label: I18n.tr("settings.wallpaper.settings.section.label")
description: I18n.tr("settings.wallpaper.settings.section.description")
}
NToggle {
label: I18n.tr("settings.wallpaper.settings.enable-management.label")
description: I18n.tr("settings.wallpaper.settings.enable-management.description")
@@ -12,10 +12,6 @@ ColumnLayout {
property var screen
NHeader {
label: I18n.tr("settings.wallpaper.look-feel.section.label")
}
NComboBox {
label: I18n.tr("settings.wallpaper.look-feel.fill-mode.label")
description: I18n.tr("settings.wallpaper.look-feel.fill-mode.description")
@@ -30,7 +30,7 @@ ColumnLayout {
currentIndex: tabView.currentIndex
NTabButton {
text: I18n.tr("settings.wallpaper.tabs.settings")
text: I18n.tr("settings.wallpaper.tabs.general")
tabIndex: 0
checked: subTabBar.currentIndex === 0
}
@@ -38,11 +38,13 @@ ColumnLayout {
text: I18n.tr("settings.wallpaper.tabs.look-feel")
tabIndex: 1
checked: subTabBar.currentIndex === 1
visible: Settings.data.wallpaper.enabled
}
NTabButton {
text: I18n.tr("settings.wallpaper.tabs.automation")
tabIndex: 2
checked: subTabBar.currentIndex === 2
visible: Settings.data.wallpaper.enabled
}
}
@@ -55,7 +57,7 @@ ColumnLayout {
id: tabView
currentIndex: subTabBar.currentIndex
SettingsSubTab {
GeneralSubTab {
screen: root.screen
onOpenMainFolderPicker: root.openMainFolderPicker()
onOpenMonitorFolderPicker: monitorName => root.openMonitorFolderPicker(monitorName)
+3 -1
View File
@@ -103,7 +103,9 @@ Singleton {
// Only show toast if we have a valid profile name (not "Unknown")
const profileName = root.getName();
if (profileName !== "Unknown") {
ToastService.showNotice(I18n.tr("toast.power-profile.profile-name", {"profile": profileName}), I18n.tr("toast.power-profile.changed"), profileName.toLowerCase().replace(" ", ""));
ToastService.showNotice(I18n.tr("toast.power-profile.profile-name", {
"profile": profileName
}), I18n.tr("toast.power-profile.changed"), profileName.toLowerCase().replace(" ", ""));
}
}
}
+3 -1
View File
@@ -17,6 +17,7 @@ Singleton {
property bool wlsunsetAvailable: false
property bool app2unitAvailable: false
property bool gnomeCalendarAvailable: false
property bool wtypeAvailable: false
// Programs to check - maps property names to commands
readonly property var programsToCheck: ({
@@ -25,7 +26,8 @@ Singleton {
"nmcliAvailable": ["sh", "-c", "command -v nmcli"],
"wlsunsetAvailable": ["sh", "-c", "command -v wlsunset"],
"app2unitAvailable": ["sh", "-c", "command -v app2unit"],
"gnomeCalendarAvailable": ["sh", "-c", "command -v gnome-calendar"]
"gnomeCalendarAvailable": ["sh", "-c", "command -v gnome-calendar"],
"wtypeAvailable": ["sh", "-c", "command -v wtype"]
})
// Discord client auto-detection