From be8b7ae4368a5cf8a99c92fb656cb9470b8046e3 Mon Sep 17 00:00:00 2001 From: zach Date: Tue, 16 Jun 2026 10:15:57 +0200 Subject: [PATCH] config option for min brightness + clipboard config options now in settings --- Components/BaseStyledSlider.qml | 3 - Config/Config.qml | 1 + Config/Services.qml | 1 + Helpers/Brightness.qml | 2 +- Modules/Clipboard/Wrapper.qml | 2 +- Modules/Osd/Content.qml | 2 + Modules/Settings/Categories/Services.qml | 12 ++++ Modules/Settings/Categories/Utilities.qml | 69 +++++++++++++++++++++++ scripts/SettingsIndex.mjs | 50 ++++++++++++++++ 9 files changed, 137 insertions(+), 5 deletions(-) diff --git a/Components/BaseStyledSlider.qml b/Components/BaseStyledSlider.qml index 48c8f33..efdacad 100644 --- a/Components/BaseStyledSlider.qml +++ b/Components/BaseStyledSlider.qml @@ -12,11 +12,8 @@ Slider { readonly property bool isVertical: orientation === Qt.Vertical property real multiplier: 100 property real oldValue - - // Wrapper components can inject their own track visuals here. property Component trackContent - // Keep current behavior for existing usages. orientation: Qt.Vertical background: CustomRect { diff --git a/Config/Config.qml b/Config/Config.qml index f7f8600..a12cb8f 100644 --- a/Config/Config.qml +++ b/Config/Config.qml @@ -330,6 +330,7 @@ Singleton { weatherLocation: services.weatherLocation, updates: services.updates, useFahrenheit: services.useFahrenheit, + minBrightness: services.minBrightness, ddcutilService: services.ddcutilService, useTwelveHourClock: services.useTwelveHourClock, gpuType: services.gpuType, diff --git a/Config/Services.qml b/Config/Services.qml index 4711120..9645d1d 100644 --- a/Config/Services.qml +++ b/Config/Services.qml @@ -8,6 +8,7 @@ JsonObject { property string defaultPlayer: "Spotify" property string gpuType: "" property real maxVolume: 1.0 + property real minBrightness: 0.01 property list playerAliases: [ { "from": "com.github.th_ch.youtube_music", diff --git a/Helpers/Brightness.qml b/Helpers/Brightness.qml index 5e2e7fb..f7b3a8b 100644 --- a/Helpers/Brightness.qml +++ b/Helpers/Brightness.qml @@ -232,7 +232,7 @@ Singleton { } function setBrightness(value: real): void { - value = Math.max(0, Math.min(1, value)); + value = Math.max(Config.services.minBrightness, Math.min(1, value)); const rounded = Math.round(value * 100); if (Math.round(brightness * 100) === rounded) return; diff --git a/Modules/Clipboard/Wrapper.qml b/Modules/Clipboard/Wrapper.qml index b1500a3..fff295e 100644 --- a/Modules/Clipboard/Wrapper.qml +++ b/Modules/Clipboard/Wrapper.qml @@ -11,7 +11,7 @@ Item { property int contentHeight property real offsetScale: shouldBeActive ? 0 : 1 required property ShellScreen screen - readonly property bool shouldBeActive: visibilities.clipboard + readonly property bool shouldBeActive: visibilities.clipboard && Config.clipboard.enabled required property PersistentProperties visibilities anchors.bottomMargin: (-implicitHeight - 5) * offsetScale diff --git a/Modules/Osd/Content.qml b/Modules/Osd/Content.qml index ef5ce62..fca3fc2 100644 --- a/Modules/Osd/Content.qml +++ b/Modules/Osd/Content.qml @@ -97,7 +97,9 @@ Item { FilledSlider { anchors.fill: parent + from: Config.services.minBrightness icon: `brightness_${(Math.round(value * 6) + 1)}` + to: 1.0 value: root.brightness onPressedChanged: { diff --git a/Modules/Settings/Categories/Services.qml b/Modules/Settings/Categories/Services.qml index d730c74..c1ef0c4 100644 --- a/Modules/Settings/Categories/Services.qml +++ b/Modules/Settings/Categories/Services.qml @@ -92,6 +92,18 @@ SettingsPage { Separator { } + SettingSpinBox { + max: 1.0 + min: 0 + name: "Minimum brightness" + object: Config.services + setting: "minBrightness" + step: 0.01 + } + + Separator { + } + SettingSpinBox { max: 5 min: 0 diff --git a/Modules/Settings/Categories/Utilities.qml b/Modules/Settings/Categories/Utilities.qml index a40af60..2e5fee7 100644 --- a/Modules/Settings/Categories/Utilities.qml +++ b/Modules/Settings/Categories/Utilities.qml @@ -46,6 +46,75 @@ SettingsPage { } } + SettingsSection { + sectionId: "Clipboard" + + SettingsHeader { + name: "Clipboard" + } + + SettingSwitch { + name: "Enable clipboard history viewer" + object: Config.clipboard + setting: "enabled" + } + + Separator { + } + + SettingSpinBox { + max: 20 + min: 1 + name: "Max entries visible" + object: Config.clipboard + setting: "maxEntriesShown" + } + + Separator { + } + + SettingSpinBox { + max: 80 + min: 30 + name: "Entry height" + object: Config.clipboard.sizes + setting: "itemHeight" + } + + Separator { + } + + SettingSpinBox { + max: 700 + min: 300 + name: "Entry width" + object: Config.clipboard.sizes + setting: "width" + } + + Separator { + } + + SettingSpinBox { + max: 1800 + min: 50 + name: "Minimum preview width" + object: Config.clipboard.sizes + setting: "minPreviewWidth" + } + + Separator { + } + + SettingSpinBox { + max: 1800 + min: 50 + name: "Maximum preview width" + object: Config.clipboard.sizes + setting: "previewWidth" + } + } + SettingsSection { sectionId: "Toasts" diff --git a/scripts/SettingsIndex.mjs b/scripts/SettingsIndex.mjs index ba5eaed..319853d 100644 --- a/scripts/SettingsIndex.mjs +++ b/scripts/SettingsIndex.mjs @@ -414,6 +414,13 @@ export const settingsIndex = [ section: "Media", keywords: ["screen", "step", "increment"], }, + { + name: "Minimum brightness", + category: "services", + categoryName: "Services", + section: "Media", + keywords: ["brightness", "minimum", "screen"], + }, { name: "Max volume", category: "services", @@ -563,6 +570,49 @@ export const settingsIndex = [ section: "Utilities", keywords: ["notification", "size", "width"], }, + // Clipboard section + { + name: "Enable clipboard history viewer", + category: "utilities", + categoryName: "Utilities", + section: "Clipboard", + keywords: ["enable", "clipboard"], + }, + { + name: "Max entries visible", + category: "utilities", + categoryName: "Utilities", + section: "Clipboard", + keywords: ["clipboard", "max"], + }, + { + name: "Entry height", + category: "utilities", + categoryName: "Utilities", + section: "Clipboard", + keywords: ["height", "entry"], + }, + { + name: "Entry width", + category: "utilities", + categoryName: "Utilities", + section: "Clipboard", + keywords: ["width", "entry"], + }, + { + name: "Minimum preview width", + category: "utilities", + categoryName: "Utilities", + section: "Clipboard", + keywords: ["minimum", "preview", "width"], + }, + { + name: "Maximum preview width", + category: "utilities", + categoryName: "Utilities", + section: "Clipboard", + keywords: ["maximum", "preview", "width"], + }, // Toasts section { name: "Config loaded",