LockScreen: fix scaling
This commit is contained in:
parent
14ea1f5e66
commit
1564992442
2 changed files with 32 additions and 16 deletions
|
|
@ -6,6 +6,8 @@ import qs.Commons
|
|||
Singleton {
|
||||
id: root
|
||||
|
||||
// -------------------------------------------
|
||||
// Manual scaling via Settings
|
||||
function scale(aScreen) {
|
||||
return scaleByName(aScreen.name)
|
||||
}
|
||||
|
|
@ -23,4 +25,17 @@ Singleton {
|
|||
|
||||
return 1.0
|
||||
}
|
||||
|
||||
// -------------------------------------------
|
||||
// Dynamic scaling based on resolution
|
||||
|
||||
// Design reference resolution (for scale = 1.0)
|
||||
readonly property int designScreenWidth: 2560
|
||||
readonly property int designScreenHeight: 1440
|
||||
|
||||
function dynamicScale(aScreen) {
|
||||
var ratioW = aScreen.width / designScreenWidth
|
||||
var ratioH = aScreen.height / designScreenHeight
|
||||
return Math.min(ratioW, ratioH)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue