mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Scaling: many improvements and fixes
- radius are not pixels, they should not be scaled - use "screen" instead of "Screen" which helps a lot in some places
This commit is contained in:
+5
-8
@@ -9,17 +9,14 @@ Singleton {
|
||||
id: root
|
||||
|
||||
// Design screen width
|
||||
readonly property int designScreenWidth: 1920
|
||||
|
||||
// Scaling dampening factor - reduces the scaling effect for higher resolutions
|
||||
readonly property real scalingDampening: 0.2
|
||||
readonly property int designScreenWidth: 2560
|
||||
|
||||
// Automatic scaling based on screen width
|
||||
function scale(currentScreen) {
|
||||
if (currentScreen !== undefined) {
|
||||
var rawRatio = currentScreen.width / designScreenWidth;
|
||||
// Apply dampening to reduce scaling for higher resolutions
|
||||
return Math.min(2.0, 1.0 + (rawRatio - 1.0) * scalingDampening);
|
||||
if (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));
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user