Files
VkuMonitor/qml/Utils/Ui.qml
2024-07-03 19:11:29 +09:00

19 lines
428 B
QML

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
}
}