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