First implementation
This commit is contained in:
18
qml/Utils/Ui.qml
Normal file
18
qml/Utils/Ui.qml
Normal file
@@ -0,0 +1,18 @@
|
||||
pragma Singleton
|
||||
|
||||
import QtQml 2.12
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Window 2.12
|
||||
|
||||
Item {
|
||||
property real currentWidth: 1024
|
||||
property real currentHeight: 768
|
||||
|
||||
property real referenceWidth: 1024
|
||||
property real referenceHeight: 768
|
||||
|
||||
function scale(size) {
|
||||
const value = Math.max(Math.round(size * Math.min(currentWidth / referenceWidth, currentHeight / referenceHeight)), 1)
|
||||
return value
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user