From 73267d1d37b60c963fc4f938acab1eef8a655fe7 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Mon, 20 Oct 2025 13:33:46 -0400 Subject: [PATCH] Settings + SetupWizard - Added a Lock screen settings tabs - Added button in settings/general tab to re-run the setup wizard - Fixed missing translations - Fixed bug when matugen not installed in setup wizard - Added enabled property for NToggle --- Assets/Translations/de.json | 28 ++++++++--------- Assets/Translations/en.json | 26 +++++++-------- Assets/Translations/es.json | 28 ++++++++--------- Assets/Translations/fr.json | 28 ++++++++--------- Assets/Translations/pt.json | 28 ++++++++--------- Assets/Translations/zh-CN.json | 28 ++++++++--------- Commons/TablerIcons.qml | 1 + Modules/Settings/SettingsPanel.qml | 11 +++++++ Modules/Settings/Tabs/ColorSchemeTab.qml | 2 +- Modules/Settings/Tabs/GeneralTab.qml | 25 ++++----------- Modules/Settings/Tabs/LockScreenTab.qml | 31 ++++++++++++++++++ Modules/Settings/Tabs/UserInterfaceTab.qml | 7 ----- Modules/SetupWizard/SetupAppearanceStep.qml | 35 ++------------------- Widgets/NToggle.qml | 8 +++++ 14 files changed, 138 insertions(+), 148 deletions(-) create mode 100644 Modules/Settings/Tabs/LockScreenTab.qml diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 396c0e6d5..6907ed912 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -32,16 +32,6 @@ "reset": "Eckenradius des Bildschirms zurücksetzen" } }, - "lockscreen": { - "section": { - "label": "Sperrbildschirm", - "description": "Hier kannst du deinen Sperrbildschirm konfigurieren." - }, - "lock-on-suspend": { - "label": "Beim Standby sperren", - "description": "Bildschirm automatisch sperren, wenn das System in den Standby-Modus wechselt." - } - }, "fonts": { "section": { "label": "Schriftarten", @@ -79,7 +69,8 @@ "description": "Wählen die in der Anwendungsoberfläche verwendete Sprache.", "auto-detect": "Automatisch" } - } + }, + "launch-setup-wizard": "Starte den Setup-Assistenten" }, "audio": { "title": "Audio", @@ -802,10 +793,6 @@ "label": "Eckenradius", "reset": "Rahmenradius zurücksetzen" }, - "compact-lockscreen": { - "description": "Zeige nur die Login-Eingabe und Systemsteuerung, blende Wetter- und Medien-Widgets aus.", - "label": "Kompakter Sperrbildschirm" - }, "dim-desktop": { "description": "Den Desktop abdunkeln, wenn Bedienfelder oder Menüs geöffnet sind.", "label": "Dim Desktop" @@ -824,6 +811,17 @@ "description": "Tooltips in der gesamten Benutzeroberfläche aktivieren oder deaktivieren.", "label": "Tooltips anzeigen" } + }, + "lock-screen": { + "compact-lockscreen": { + "description": "Zeige nur die Login-Eingabe und Systemsteuerung, blende Wetter- und Medien-Widgets aus.", + "label": "Kompakter Sperrbildschirm" + }, + "lock-on-suspend": { + "description": "Den Bildschirm beim Suspendieren des Systems automatisch sperren.", + "label": "Sperren beim Ruhezustand" + }, + "title": "Sperrbildschirm" } }, "general": { diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 88acd5c9f..f8c8286f7 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -2,6 +2,7 @@ "settings": { "general": { "title": "General", + "launch-setup-wizard": "Launch the setup wizard", "profile": { "section": { "label": "Profile", @@ -32,16 +33,6 @@ "reset": "Reset screen corners radius" } }, - "lockscreen": { - "section": { - "label": "Lock screen", - "description": "Configure lock screen behavior." - }, - "lock-on-suspend": { - "label": "Lock on suspend", - "description": "Automatically lock the screen when suspending the system." - } - }, "fonts": { "reset-scaling": "Reset scaling", "section": { @@ -806,10 +797,6 @@ "label": "Dim desktop", "description": "Dim the desktop when panels or menus are open." }, - "compact-lockscreen": { - "label": "Compact lock screen", - "description": "Show only the login input and system controls, hiding weather and media widgets." - }, "border-radius": { "label": "Border radius", "description": "Controls the corner roundness of windows, buttons, and other elements.", @@ -824,6 +811,17 @@ "label": "Disable UI Animations", "description": "Disable all animations for a faster, more responsive experience." } + }, + "lock-screen": { + "title": "Lock screen", + "compact-lockscreen": { + "label": "Compact lock screen", + "description": "Show only the login input and system controls, hiding weather and media widgets." + }, + "lock-on-suspend": { + "label": "Lock on suspend", + "description": "Automatically lock the screen when suspending the system." + } } }, "widgets": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index aa00ce0af..c6311f6dd 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -32,16 +32,6 @@ "reset": "Restablecer el radio de las esquinas de la pantalla" } }, - "lockscreen": { - "section": { - "label": "Pantalla de bloqueo", - "description": "Configura el comportamiento de la pantalla de bloqueo." - }, - "lock-on-suspend": { - "label": "Bloquear al suspender", - "description": "Bloquear automáticamente la pantalla al suspender el sistema." - } - }, "fonts": { "section": { "label": "Fuentes", @@ -79,7 +69,8 @@ "description": "Selecciona el idioma utilizado en la interfaz de la aplicación.", "auto-detect": "Automático" } - } + }, + "launch-setup-wizard": "Inicie el asistente de configuración" }, "audio": { "title": "Audio", @@ -802,10 +793,6 @@ "label": "Radio de borde", "reset": "Restablecer el radio del borde" }, - "compact-lockscreen": { - "description": "Mostrar solo el campo de inicio de sesión y los controles del sistema, ocultando los widgets del clima y multimedia.", - "label": "Pantalla de bloqueo compacta" - }, "dim-desktop": { "description": "Atenuar el escritorio cuando los paneles o menús estén abiertos.", "label": "Dim escritorio" @@ -824,6 +811,17 @@ "description": "Activar o desactivar los avisos emergentes en toda la interfaz.", "label": "Mostrar sugerencias" } + }, + "lock-screen": { + "compact-lockscreen": { + "description": "Mostrar solo el campo de inicio de sesión y los controles del sistema, ocultando los widgets del clima y multimedia.", + "label": "Pantalla de bloqueo compacta" + }, + "lock-on-suspend": { + "description": "Bloquear la pantalla automáticamente al suspender el sistema.", + "label": "Bloquear al suspender" + }, + "title": "Pantalla de bloqueo" } }, "widgets": { diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index d15b0c422..c50cf02e6 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -32,16 +32,6 @@ "reset": "Réinitialiser le rayon des coins de l'écran" } }, - "lockscreen": { - "section": { - "label": "Écran de verrouillage", - "description": "Configurer le comportement de l'écran de verrouillage." - }, - "lock-on-suspend": { - "label": "Verrouiller lors de la suspension", - "description": "Verrouiller automatiquement l'écran lors de la mise en veille du système." - } - }, "fonts": { "section": { "label": "Polices", @@ -79,7 +69,8 @@ "description": "Sélectionnez la langue utilisée dans l'interface de l'application.", "auto-detect": "Automatique" } - } + }, + "launch-setup-wizard": "Lancer l'assistant d'installation" }, "audio": { "title": "Audio", @@ -802,10 +793,6 @@ "label": "Rayon de bordure", "reset": "Réinitialiser le rayon de la bordure" }, - "compact-lockscreen": { - "description": "Afficher uniquement le champ de saisie de connexion et les commandes système, en masquant les widgets météo et multimédia.", - "label": "Écran de verrouillage compact" - }, "dim-desktop": { "description": "Atténuer le bureau lorsque des panneaux ou des menus sont ouverts.", "label": "Dim bureau" @@ -824,6 +811,17 @@ "description": "Activer ou désactiver les info-bulles dans toute l'interface.", "label": "Afficher les infobulles" } + }, + "lock-screen": { + "compact-lockscreen": { + "description": "Afficher uniquement le champ de saisie de connexion et les commandes système, en masquant les widgets météo et multimédia.", + "label": "Écran de verrouillage compact" + }, + "lock-on-suspend": { + "description": "Verrouiller automatiquement l'écran lors de la mise en veille du système.", + "label": "Verrouiller à la suspension" + }, + "title": "Écran de verrouillage" } }, "widgets": { diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index b72251e75..ccc2cfa1d 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -32,16 +32,6 @@ "reset": "Redefinir raio dos cantos da tela" } }, - "lockscreen": { - "section": { - "label": "Tela de bloqueio", - "description": "Configure o comportamento da tela de bloqueio." - }, - "lock-on-suspend": { - "label": "Bloquear ao suspender", - "description": "Bloquear automaticamente a tela ao suspender o sistema." - } - }, "fonts": { "section": { "label": "Fontes", @@ -79,7 +69,8 @@ "description": "Selecione o idioma usado na interface da aplicação.", "auto-detect": "Automático" } - } + }, + "launch-setup-wizard": "Iniciar o assistente de configuração" }, "audio": { "title": "Áudio", @@ -802,10 +793,6 @@ "label": "Raio da borda", "reset": "Redefinir raio da borda" }, - "compact-lockscreen": { - "description": "Mostrar apenas a entrada de login e os controles do sistema, ocultando widgets de clima e mídia.", - "label": "Tela de bloqueio compacta" - }, "dim-desktop": { "description": "Escurecer a área de trabalho quando painéis ou menus estiverem abertos.", "label": "Dim área de trabalho" @@ -824,6 +811,17 @@ "description": "Ativar ou desativar dicas de ferramentas em toda a interface.", "label": "Mostrar dicas de ferramenta" } + }, + "lock-screen": { + "compact-lockscreen": { + "description": "Mostrar apenas a entrada de login e os controles do sistema, ocultando os widgets de clima e mídia.", + "label": "Tela de bloqueio compacta" + }, + "lock-on-suspend": { + "description": "Bloquear a tela automaticamente ao suspender o sistema.", + "label": "Bloquear ao suspender" + }, + "title": "Tela de bloqueio" } }, "widgets": { diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index d98916794..e46e952e6 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -32,16 +32,6 @@ "reset": "重置屏幕圆角半径" } }, - "lockscreen": { - "section": { - "label": "锁屏", - "description": "配置锁屏行为。" - }, - "lock-on-suspend": { - "label": "挂起时锁定", - "description": "在系统挂起时自动锁定屏幕。" - } - }, "fonts": { "reset-scaling": "恢复默认缩放", "section": { @@ -79,7 +69,8 @@ "description": "选择应用程序界面中使用的语言。", "auto-detect": "自动检测" } - } + }, + "launch-setup-wizard": "启动安装向导" }, "audio": { "title": "音频", @@ -802,10 +793,6 @@ "label": "边框半径", "reset": "重置边框半径" }, - "compact-lockscreen": { - "description": "仅显示登录输入和系统控制,隐藏天气和媒体小部件。", - "label": "紧凑型锁屏" - }, "dim-desktop": { "description": "当面板或菜单打开时,桌面变暗。", "label": "昏暗的桌面" @@ -824,6 +811,17 @@ "description": "启用或禁用整个界面的工具提示。", "label": "显示工具提示" } + }, + "lock-screen": { + "compact-lockscreen": { + "description": "仅显示登录输入和系统控制,隐藏天气和媒体小部件。", + "label": "紧凑型锁屏" + }, + "lock-on-suspend": { + "description": "系统挂起时自动锁定屏幕。", + "label": "挂起时锁定" + }, + "title": "锁屏" } }, "widgets": { diff --git a/Commons/TablerIcons.qml b/Commons/TablerIcons.qml index a840d72f6..59b226d3e 100644 --- a/Commons/TablerIcons.qml +++ b/Commons/TablerIcons.qml @@ -119,6 +119,7 @@ Singleton { "settings-notifications": "bell", "settings-osd": "picture-in-picture", "settings-about": "info-square-rounded", + "settings-lock-screen": "lock", "bluetooth": "bluetooth", "bt-device-generic": "bluetooth", "bt-device-headphones": "headphones", diff --git a/Modules/Settings/SettingsPanel.qml b/Modules/Settings/SettingsPanel.qml index e5b645667..47ebc40a0 100644 --- a/Modules/Settings/SettingsPanel.qml +++ b/Modules/Settings/SettingsPanel.qml @@ -26,6 +26,7 @@ NPanel { Audio, Bar, ColorScheme, + LockScreen, ControlCenter, OSD, Display, @@ -118,6 +119,11 @@ NPanel { id: userInterfaceTab UserInterfaceTab {} } + Component { + id: lockScreenTab + LockScreenTab {} + } + // Order *DOES* matter function updateTabsModel() { let newTabs = [{ @@ -150,6 +156,11 @@ NPanel { "label": "settings.launcher.title", "icon": "settings-launcher", "source": launcherTab + }, { + "id": SettingsPanel.Tab.LockScreen, + "label": "settings.lock-screen.title", + "icon": "settings-lock-screen", + "source": lockScreenTab }, { "id": SettingsPanel.Tab.Audio, "label": "settings.audio.title", diff --git a/Modules/Settings/Tabs/ColorSchemeTab.qml b/Modules/Settings/Tabs/ColorSchemeTab.qml index 81146436e..bbd02a8e7 100644 --- a/Modules/Settings/Tabs/ColorSchemeTab.qml +++ b/Modules/Settings/Tabs/ColorSchemeTab.qml @@ -159,7 +159,6 @@ ColumnLayout { label: I18n.tr("settings.color-scheme.dark-mode.switch.label") description: I18n.tr("settings.color-scheme.dark-mode.switch.description") checked: Settings.data.colorSchemes.darkMode - enabled: true onToggled: checked => { Settings.data.colorSchemes.darkMode = checked root.cacheVersion++ // Force UI update for dark/light variants @@ -241,6 +240,7 @@ ColumnLayout { NToggle { label: I18n.tr("settings.color-scheme.color-source.use-wallpaper-colors.label") description: I18n.tr("settings.color-scheme.color-source.use-wallpaper-colors.description") + enabled: ProgramCheckerService.matugenAvailable checked: Settings.data.colorSchemes.useWallpaperColors onToggled: checked => { if (checked) { diff --git a/Modules/Settings/Tabs/GeneralTab.qml b/Modules/Settings/Tabs/GeneralTab.qml index 4f0844455..d750f3c7d 100644 --- a/Modules/Settings/Tabs/GeneralTab.qml +++ b/Modules/Settings/Tabs/GeneralTab.qml @@ -230,26 +230,13 @@ ColumnLayout { Layout.topMargin: Style.marginXL Layout.bottomMargin: Style.marginXL } - ColumnLayout { - spacing: Style.marginL - Layout.fillWidth: true - NHeader { - label: I18n.tr("settings.general.lockscreen.section.label") - description: I18n.tr("settings.general.lockscreen.section.description") + NButton { + visible: !DistroService.isNixOS + text: I18n.tr("settings.general.launch-setup-wizard") + onClicked: { + setupWizardLoader.active = false + setupWizardLoader.active = true } - - NToggle { - label: I18n.tr("settings.general.lockscreen.lock-on-suspend.label") - description: I18n.tr("settings.general.lockscreen.lock-on-suspend.description") - checked: Settings.data.general.lockOnSuspend - onToggled: Settings.data.general.lockOnSuspend = checked - } - } - - NDivider { - Layout.fillWidth: true - Layout.topMargin: Style.marginXL - Layout.bottomMargin: Style.marginXL } } diff --git a/Modules/Settings/Tabs/LockScreenTab.qml b/Modules/Settings/Tabs/LockScreenTab.qml new file mode 100644 index 000000000..2b9d0ea7e --- /dev/null +++ b/Modules/Settings/Tabs/LockScreenTab.qml @@ -0,0 +1,31 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import qs.Commons +import qs.Services +import qs.Widgets + +ColumnLayout { + id: root + + NToggle { + label: I18n.tr("settings.lock-screen.lock-on-suspend.label") + description: I18n.tr("settings.lock-screen.lock-on-suspend.description") + checked: Settings.data.general.lockOnSuspend + onToggled: Settings.data.general.lockOnSuspend = checked + } + + NToggle { + label: I18n.tr("settings.lock-screen.compact-lockscreen.label") + description: I18n.tr("settings.lock-screen.compact-lockscreen.description") + checked: Settings.data.general.compactLockScreen + onToggled: checked => Settings.data.general.compactLockScreen = checked + } + + NDivider { + Layout.fillWidth: true + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL + } +} diff --git a/Modules/Settings/Tabs/UserInterfaceTab.qml b/Modules/Settings/Tabs/UserInterfaceTab.qml index 13557c297..cffb74898 100644 --- a/Modules/Settings/Tabs/UserInterfaceTab.qml +++ b/Modules/Settings/Tabs/UserInterfaceTab.qml @@ -33,13 +33,6 @@ ColumnLayout { onToggled: checked => Settings.data.ui.tooltipsEnabled = checked } - NToggle { - label: I18n.tr("settings.user-interface.compact-lockscreen.label") - description: I18n.tr("settings.user-interface.compact-lockscreen.description") - checked: Settings.data.general.compactLockScreen - onToggled: checked => Settings.data.general.compactLockScreen = checked - } - NDivider { Layout.fillWidth: true Layout.topMargin: Style.marginL diff --git a/Modules/SetupWizard/SetupAppearanceStep.qml b/Modules/SetupWizard/SetupAppearanceStep.qml index e247e0704..a59b2ad37 100644 --- a/Modules/SetupWizard/SetupAppearanceStep.qml +++ b/Modules/SetupWizard/SetupAppearanceStep.qml @@ -124,14 +124,14 @@ ColumnLayout { spacing: 2 NText { - text: I18n.tr("settings.color-scheme.color-source.dark-mode.label") + text: I18n.tr("settings.color-scheme.dark-mode.switch.label") pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurface } NText { - text: I18n.tr("settings.color-scheme.color-source.dark-mode.description") + text: I18n.tr("settings.color-scheme.dark-mode.switch.description") pointSize: Style.fontSizeS color: Color.mOnSurfaceVariant wrapMode: Text.WordWrap @@ -167,7 +167,7 @@ ColumnLayout { color: Color.mSurface NIcon { - icon: "color-picker" + icon: ProgramCheckerService.matugenAvailable ? "color-picker" : "alert-triangle" pointSize: Style.fontSizeL color: Color.mPrimary anchors.centerIn: parent @@ -196,7 +196,6 @@ ColumnLayout { NToggle { enabled: ProgramCheckerService.matugenAvailable - opacity: ProgramCheckerService.matugenAvailable ? 1.0 : 0.6 checked: Settings.data.colorSchemes.useWallpaperColors && ProgramCheckerService.matugenAvailable onToggled: checked => { if (!ProgramCheckerService.matugenAvailable) @@ -214,34 +213,6 @@ ColumnLayout { } } - // Matugen not available notice - RowLayout { - Layout.fillWidth: true - spacing: Style.marginS - visible: !ProgramCheckerService.matugenAvailable - - Rectangle { - width: 28 - height: 28 - radius: Style.radiusM - color: Color.mSurface - NIcon { - icon: "alert-triangle" - pointSize: Style.fontSizeL - color: Color.mPrimary - anchors.centerIn: parent - } - } - NText { - text: I18n.tr("settings.color-scheme.color-source.use-wallpaper-colors.description") - // Reuse description; availability is visually indicated - pointSize: Style.fontSizeS - color: Color.mOnSurfaceVariant - wrapMode: Text.WordWrap - Layout.fillWidth: true - } - } - // Matugen scheme type (visible when wallpaper colors enabled and matugen available) ColumnLayout { Layout.fillWidth: true diff --git a/Widgets/NToggle.qml b/Widgets/NToggle.qml index 18259ed67..45ad8bc36 100644 --- a/Widgets/NToggle.qml +++ b/Widgets/NToggle.qml @@ -9,6 +9,7 @@ RowLayout { property string label: "" property string description: "" + property bool enabled: true property bool checked: false property bool hovering: false property int baseSize: Math.round(Style.baseWidgetSize * 0.8 * Style.uiScaleRatio) @@ -18,6 +19,7 @@ RowLayout { signal exited Layout.fillWidth: true + opacity: enabled ? 1.0 : 0.6 NLabel { label: root.label @@ -71,14 +73,20 @@ RowLayout { cursorShape: Qt.PointingHandCursor hoverEnabled: true onEntered: { + if (!enabled) + return hovering = true root.entered() } onExited: { + if (!enabled) + return hovering = false root.exited() } onClicked: { + if (!enabled) + return root.toggled(!root.checked) } }