From e564ec2a7cf234c491eaa94adf1109ab2a012cf3 Mon Sep 17 00:00:00 2001 From: loner <2788892716@qq.com> Date: Sat, 18 Oct 2025 21:54:41 +0800 Subject: [PATCH] feat: Add adjustable dock size setting --- Assets/Translations/en.json | 6 +++++- Assets/settings-default.json | 3 ++- Commons/Settings.qml | 1 + Modules/Dock/Dock.qml | 2 +- Modules/Settings/Tabs/DockTab.qml | 18 ++++++++++++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index e8ee372b..8fb27cb5 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -269,7 +269,11 @@ }, "floating-distance": { "label": "Dock floating distance", - "description": "Adjust the floating distance from the screen edge." + "description": "Set the distance between the dock and the edge of the screen." + }, + "icon-size": { + "label": "Dock size", + "description": "Adjust the overall size of the dock." }, "colorize-icons": { "label": "Colorize Icons", diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 27f2b735..a62c77eb 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -172,7 +172,8 @@ "onlySameOutput": true, "monitors": [], "pinnedApps": [], - "colorizeIcons": false + "colorizeIcons": false, + "size": 1 }, "network": { "wifiEnabled": true diff --git a/Commons/Settings.qml b/Commons/Settings.qml index a0306c13..44f30145 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -293,6 +293,7 @@ Singleton { property string displayMode: "always_visible" // "always_visible", "auto_hide", "exclusive" property real backgroundOpacity: 1.0 property real floatingRatio: 1.0 + property real size: 1 property bool onlySameOutput: true property list monitors: [] // Desktop entry IDs pinned to the dock (e.g., "org.kde.konsole", "firefox.desktop") diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 9bdf82cc..8e60bbf3 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -63,7 +63,7 @@ Variants { readonly property int hideAnimationDuration: Style.animationFast readonly property int showAnimationDuration: Style.animationFast readonly property int peekHeight: 1 - readonly property int iconSize: 36 + readonly property int iconSize: Math.round(12 + 24 * (Settings.data.dock.size ?? 1)) readonly property int floatingMargin: Settings.data.dock.floatingRatio * Style.marginL // Bar detection and positioning properties diff --git a/Modules/Settings/Tabs/DockTab.qml b/Modules/Settings/Tabs/DockTab.qml index 3203446e..c7f1d258 100644 --- a/Modules/Settings/Tabs/DockTab.qml +++ b/Modules/Settings/Tabs/DockTab.qml @@ -87,6 +87,24 @@ ColumnLayout { } } + ColumnLayout { + 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 { label: I18n.tr("settings.dock.monitors.only-same-output.label") description: I18n.tr("settings.dock.monitors.only-same-output.description")