diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 266fe41b..852aca2d 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -257,6 +257,10 @@ }, "dock": { "title": "Dock", + "enabled": { + "label": "Dock aktivieren", + "description": "Dock vollständig anzeigen oder ausblenden" + }, "appearance": { "section": { "label": "Erscheinungsbild", diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 7730e029..0d1c536b 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -257,6 +257,10 @@ }, "dock": { "title": "Dock", + "enabled": { + "label": "Enable dock", + "description": "Show or hide the dock entirely" + }, "appearance": { "section": { "label": "Appearance", diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 08b719f6..3038f95f 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -257,6 +257,10 @@ }, "dock": { "title": "Dock", + "enabled": { + "label": "Habilitar dock", + "description": "Mostrar u ocultar el dock por completo" + }, "appearance": { "section": { "label": "Apariencia", diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 163793dc..eef16e9c 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -257,6 +257,10 @@ }, "dock": { "title": "Dock", + "enabled": { + "label": "Activer le dock", + "description": "Afficher ou masquer complètement le dock" + }, "appearance": { "section": { "label": "Apparence", diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index b3d0a9de..ca941c86 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -257,6 +257,10 @@ }, "dock": { "title": "Dock", + "enabled": { + "label": "Ativar dock", + "description": "Mostrar ou ocultar o dock completamente" + }, "appearance": { "section": { "label": "Aparência", diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 52f3a435..7e38f087 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -257,6 +257,10 @@ }, "dock": { "title": "Dock", + "enabled": { + "label": "启用 Dock", + "description": "完全显示或隐藏 Dock" + }, "appearance": { "section": { "label": "外观", diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 6c9ea911..305befd0 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -172,6 +172,7 @@ ] }, "dock": { + "enabled": true, "displayMode": "always_visible", "backgroundOpacity": 1, "floatingRatio": 1, diff --git a/Commons/Settings.qml b/Commons/Settings.qml index f23a952f..29b803ff 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -296,6 +296,7 @@ Singleton { // dock property JsonObject dock: JsonObject { + property bool enabled: true property string displayMode: "always_visible" // "always_visible", "auto_hide", "exclusive" property real backgroundOpacity: 1.0 property real floatingRatio: 1.0 diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 391e9965..f0caacbd 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -186,7 +186,7 @@ Variants { // PEEK WINDOW - Always visible when auto-hide is enabled Loader { - active: (barIsReady || !hasBar) && modelData && Settings.data.dock.monitors.includes(modelData.name) && autoHide + active: Settings.data.dock.enabled && (barIsReady || !hasBar) && modelData && (Settings.data.dock.monitors.length === 0 || Settings.data.dock.monitors.includes(modelData.name)) && autoHide sourceComponent: PanelWindow { id: peekWindow @@ -226,7 +226,7 @@ Variants { // DOCK WINDOW Loader { - active: (barIsReady || !hasBar) && modelData && Settings.data.dock.monitors.includes(modelData.name) && dockLoaded && ToplevelManager && (dockApps.length > 0) + active: Settings.data.dock.enabled && (barIsReady || !hasBar) && modelData && (Settings.data.dock.monitors.length === 0 || Settings.data.dock.monitors.includes(modelData.name)) && dockLoaded && ToplevelManager && (dockApps.length > 0) sourceComponent: PanelWindow { id: dockWindow diff --git a/Modules/Settings/Tabs/DockTab.qml b/Modules/Settings/Tabs/DockTab.qml index c7f1d258..632a3826 100644 --- a/Modules/Settings/Tabs/DockTab.qml +++ b/Modules/Settings/Tabs/DockTab.qml @@ -29,7 +29,16 @@ ColumnLayout { description: I18n.tr("settings.dock.appearance.section.description") } + NToggle { + Layout.fillWidth: true + label: I18n.tr("settings.dock.enabled.label") + description: I18n.tr("settings.dock.enabled.description") + checked: Settings.data.dock.enabled + onToggled: checked => Settings.data.dock.enabled = checked + } + NComboBox { + visible: Settings.data.dock.enabled Layout.fillWidth: true label: I18n.tr("settings.dock.appearance.display.label") description: I18n.tr("settings.dock.appearance.display.description") @@ -50,6 +59,7 @@ ColumnLayout { } ColumnLayout { + visible: Settings.data.dock.enabled spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -68,6 +78,7 @@ ColumnLayout { } ColumnLayout { + visible: Settings.data.dock.enabled spacing: Style.marginXXS Layout.fillWidth: true @@ -88,6 +99,7 @@ ColumnLayout { } ColumnLayout { + visible: Settings.data.dock.enabled spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -106,6 +118,7 @@ ColumnLayout { } NToggle { + visible: Settings.data.dock.enabled label: I18n.tr("settings.dock.monitors.only-same-output.label") description: I18n.tr("settings.dock.monitors.only-same-output.description") checked: Settings.data.dock.onlySameOutput @@ -113,6 +126,7 @@ 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") @@ -121,6 +135,7 @@ ColumnLayout { } NDivider { + visible: Settings.data.dock.enabled Layout.fillWidth: true Layout.topMargin: Style.marginXL Layout.bottomMargin: Style.marginXL @@ -128,6 +143,7 @@ ColumnLayout { // Monitor Configuration ColumnLayout { + visible: Settings.data.dock.enabled spacing: Style.marginM Layout.fillWidth: true @@ -163,6 +179,7 @@ ColumnLayout { } NDivider { + visible: Settings.data.dock.enabled Layout.fillWidth: true Layout.topMargin: Style.marginXL Layout.bottomMargin: Style.marginXL diff --git a/Modules/SetupWizard/SetupDockStep.qml b/Modules/SetupWizard/SetupDockStep.qml new file mode 100644 index 00000000..8281906f --- /dev/null +++ b/Modules/SetupWizard/SetupDockStep.qml @@ -0,0 +1,202 @@ +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import Quickshell +import qs.Commons +import qs.Services +import qs.Widgets + +ColumnLayout { + id: root + + spacing: Style.marginM + + // Header + RowLayout { + Layout.fillWidth: true + Layout.bottomMargin: Style.marginL + spacing: Style.marginM + + Rectangle { + width: 40 + height: 40 + radius: Style.radiusL + color: Color.mSurfaceVariant + opacity: 0.6 + + NIcon { + icon: "device-desktop" + pointSize: Style.fontSizeL + color: Color.mPrimary + anchors.centerIn: parent + } + } + + ColumnLayout { + Layout.fillWidth: true + spacing: Style.marginXS + + NText { + text: I18n.tr("settings.dock.title") || "Dock" + pointSize: Style.fontSizeXL + font.weight: Style.fontWeightBold + color: Color.mPrimary + } + + NText { + text: I18n.tr("settings.dock.monitors.section.description") + pointSize: Style.fontSizeM + color: Color.mOnSurfaceVariant + } + } + } + + // Options + ColumnLayout { + Layout.fillWidth: true + spacing: Style.marginL + + NToggle { + Layout.fillWidth: true + label: I18n.tr("settings.dock.enabled.label") + description: I18n.tr("settings.dock.enabled.description") + checked: Settings.data.dock.enabled + onToggled: checked => Settings.data.dock.enabled = checked + } + + // Display behavior + NComboBox { + visible: Settings.data.dock.enabled + Layout.fillWidth: true + label: I18n.tr("settings.dock.appearance.display.label") + description: I18n.tr("settings.dock.appearance.display.description") + model: [{ + "key": "always_visible", + "name": I18n.tr("settings.dock.appearance.display.always-visible") + }, { + "key": "auto_hide", + "name": I18n.tr("settings.dock.appearance.display.auto-hide") + }, { + "key": "exclusive", + "name": I18n.tr("settings.dock.appearance.display.exclusive") + }] + currentKey: Settings.data.dock.displayMode + onSelected: key => Settings.data.dock.displayMode = key + } + + // Background opacity + ColumnLayout { + visible: Settings.data.dock.enabled + spacing: Style.marginXXS + Layout.fillWidth: true + NLabel { + label: I18n.tr("settings.dock.appearance.background-opacity.label") + description: I18n.tr("settings.dock.appearance.background-opacity.description") + } + NValueSlider { + Layout.fillWidth: true + from: 0 + to: 1 + stepSize: 0.01 + value: Settings.data.dock.backgroundOpacity + onMoved: value => Settings.data.dock.backgroundOpacity = value + text: Math.floor(Settings.data.dock.backgroundOpacity * 100) + "%" + } + } + + // Floating distance + ColumnLayout { + visible: Settings.data.dock.enabled + spacing: Style.marginXXS + Layout.fillWidth: true + NLabel { + label: I18n.tr("settings.dock.appearance.floating-distance.label") + description: I18n.tr("settings.dock.appearance.floating-distance.description") + } + NValueSlider { + Layout.fillWidth: true + from: 0 + to: 4 + stepSize: 0.01 + value: Settings.data.dock.floatingRatio + onMoved: value => Settings.data.dock.floatingRatio = value + text: Math.floor(Settings.data.dock.floatingRatio * 100) + "%" + } + } + + // Icon size + ColumnLayout { + visible: Settings.data.dock.enabled + spacing: Style.marginXXS + Layout.fillWidth: true + NLabel { + label: I18n.tr("settings.dock.appearance.icon-size.label") + description: I18n.tr("settings.dock.appearance.icon-size.description") + } + NValueSlider { + Layout.fillWidth: true + from: 0 + to: 2 + stepSize: 0.01 + value: Settings.data.dock.size + onMoved: value => Settings.data.dock.size = value + text: Math.floor(Settings.data.dock.size * 100) + "%" + } + } + + NToggle { + visible: Settings.data.dock.enabled + Layout.fillWidth: true + label: I18n.tr("settings.dock.monitors.only-same-output.label") + description: I18n.tr("settings.dock.monitors.only-same-output.description") + checked: Settings.data.dock.onlySameOutput + onToggled: checked => Settings.data.dock.onlySameOutput = checked + } + + 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") + checked: Settings.data.dock.colorizeIcons + onToggled: checked => Settings.data.dock.colorizeIcons = checked + } + + NHeader { + visible: Settings.data.dock.enabled + label: I18n.tr("settings.dock.monitors.section.label") + description: I18n.tr("settings.dock.monitors.section.description") + } + + Repeater { + visible: Settings.data.dock.enabled + model: Quickshell.screens || [] + delegate: NCheckbox { + Layout.fillWidth: true + label: modelData.name || "Unknown" + description: { + const compositorScale = CompositorService.getDisplayScale(modelData.name) + I18n.tr("system.monitor-description", { + "model": modelData.model, + "width": modelData.width * compositorScale, + "height": modelData.height * compositorScale, + "scale": compositorScale + }) + } + checked: (Settings.data.dock.monitors || []).indexOf(modelData.name) !== -1 + onToggled: checked => { + if (checked) { + const arr = (Settings.data.dock.monitors || []).slice() + if (arr.indexOf(modelData.name) === -1) + arr.push(modelData.name) + Settings.data.dock.monitors = arr + } else { + Settings.data.dock.monitors = (Settings.data.dock.monitors || []).filter(function (n) { + return n !== modelData.name + }) + } + } + } + } + } +} diff --git a/Modules/SetupWizard/SetupWizard.qml b/Modules/SetupWizard/SetupWizard.qml index 0492ea57..12be78d1 100644 --- a/Modules/SetupWizard/SetupWizard.qml +++ b/Modules/SetupWizard/SetupWizard.qml @@ -23,7 +23,7 @@ NPanel { draggable: false property int currentStep: 0 - property int totalSteps: 4 + property int totalSteps: 5 // Setup wizard data property string selectedWallpaperDirectory: Settings.defaultWallpapersDirectory @@ -214,7 +214,12 @@ NPanel { } } - // Step 3: Appearance - Dark mode and color source + // Step 3: Dock Setup + SetupDockStep { + id: stepDock + } + + // Step 4: Appearance - Dark mode and color source SetupAppearanceStep { id: step3 } @@ -248,6 +253,9 @@ NPanel { }, { "icon": "settings", "label": "Customize" + }, { + "icon": "device-desktop", + "label": "Dock" }, { "icon": "palette", "label": "Appearance"