Add ThemedSlider, change all Slider to ThemedSlider, add scaling to Display.qml, fix scaling for ToggleOption

This commit is contained in:
Ly-sec 2025-08-08 14:23:04 +02:00
parent d3c9820ddb
commit d48eb9099b
6 changed files with 97 additions and 103 deletions

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts
import Quickshell
import qs.Components
import qs.Settings
import qs.Components
ColumnLayout {
id: root
@ -417,6 +418,38 @@ ColumnLayout {
Settings.settings.notificationMonitors = monitors;
}
}
// Scale slider
ColumnLayout {
Layout.fillWidth: true
spacing: 4 * Theme.scale(screen)
Text { text: "Scale"; color: Theme.textSecondary; font.pixelSize: 10 * Theme.scale(screen) }
RowLayout {
Layout.fillWidth: true
spacing: 8 * Theme.scale(screen)
// Value read from settings override, default to Theme.scale(modelData)
property real currentValue: (Settings.settings.monitorScaleOverrides && Settings.settings.monitorScaleOverrides[monitorCard.monitorName] !== undefined) ? Settings.settings.monitorScaleOverrides[monitorCard.monitorName] : Theme.scale(modelData)
// Reusable slider component (exact style from Wallpaper.qml)
ThemedSlider {
id: scaleSlider
Layout.fillWidth: true
screen: modelData
from: 0.8
to: 2.0
stepSize: 0.05
snapAlways: true
value: parent.currentValue
onValueChanged: {
let overrides = Settings.settings.monitorScaleOverrides || {};
overrides = Object.assign({}, overrides);
overrides[monitorCard.monitorName] = value;
Settings.settings.monitorScaleOverrides = overrides;
parent.currentValue = value;
}
}
Text { text: parent.currentValue.toFixed(2); font.pixelSize: 12 * Theme.scale(screen); color: Theme.textPrimary; width: 36 }
}
}
}
}
}