Keep display scaling options consistent
This commit is contained in:
@@ -60,10 +60,7 @@ function availableScales(scales, width, height) {
|
||||
var requested = Number(scales[i])
|
||||
var effective = Number(cleanScale(requested, width, height))
|
||||
|
||||
// Clean scales round upward. If the mode cannot reach the requested
|
||||
// scale, cleanScale caps at its largest valid value and this preset is
|
||||
// not actually available.
|
||||
if (!isFinite(requested) || !isFinite(effective) || effective < requested) continue
|
||||
if (!isFinite(requested) || !isFinite(effective)) continue
|
||||
|
||||
var key = normalizeScale(effective)
|
||||
var existing = byEffectiveScale[key]
|
||||
|
||||
@@ -263,6 +263,15 @@ Panel {
|
||||
return -1
|
||||
}
|
||||
|
||||
function effectiveScale(scale) {
|
||||
for (var i = 0; i < displays.length; i++) {
|
||||
var display = displays[i]
|
||||
if (display && display.focused)
|
||||
return Model.cleanScale(scale, display.width, display.height)
|
||||
}
|
||||
return normalizeScale(scale)
|
||||
}
|
||||
|
||||
// Playful mood-name for a given brightness percent. Bands intentionally
|
||||
// span ~10–20 points so casual tweaks change the label, while small
|
||||
// nudges within one band don't.
|
||||
@@ -781,7 +790,7 @@ Panel {
|
||||
required property string scaleValue
|
||||
required property int scaleIndex
|
||||
|
||||
text: scaleValue + "x"
|
||||
text: root.effectiveScale(scaleValue) + "x"
|
||||
fontSize: Style.font.caption
|
||||
foreground: root.bar.foreground
|
||||
fontFamily: root.bar.fontFamily
|
||||
|
||||
Reference in New Issue
Block a user