mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Add ThemedSlider, change all Slider to ThemedSlider, add scaling to Display.qml, fix scaling for ToggleOption
This commit is contained in:
@@ -82,6 +82,7 @@ Singleton {
|
||||
property var barMonitors: [] // Array of monitor names to show the bar on
|
||||
property var dockMonitors: [] // Array of monitor names to show the dock on
|
||||
property var notificationMonitors: [] // Array of monitor names to show notifications on, "*" means all monitors
|
||||
property var monitorScaleOverrides: {} // Map of monitor name -> scale override (e.g., 0.8..2.0). When set, Theme.scale() returns this value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -13,7 +13,16 @@ Singleton {
|
||||
|
||||
// Automatic scaling based on screen width
|
||||
function scale(currentScreen) {
|
||||
if (currentScreen.width != 0) {
|
||||
// Per-monitor override from settings
|
||||
try {
|
||||
const overrides = Settings.settings.monitorScaleOverrides || {};
|
||||
if (currentScreen && currentScreen.name && overrides[currentScreen.name] !== undefined) {
|
||||
return overrides[currentScreen.name];
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
if (currentScreen && currentScreen.width != 0) {
|
||||
var ratio = currentScreen.width / designScreenWidth;
|
||||
// Limit the final scale range between [0.8...2]
|
||||
return Math.max(0.8, Math.min(2.0, ratio));
|
||||
|
||||
Reference in New Issue
Block a user