pragma Singleton
import QtQuick 2.12
import QtQml 2.12
import QtQuick.Window 2.12

QtObject {
    property real widthScaleFactor : (Screen.width /  (Screen.width > Screen.height ? 1620 : 1080))    // 1.3333
    property real heightScaleFactor : (Screen.height / (Screen.width > Screen.height ? 1080 : 1620))

    property real tabletScaleFactor: (Screen.width >= Screen.height ? Screen.height / 1080 : Screen.width / 1080)

    property real appIconGridWidth: 240 * tabletScaleFactor
    property real appIconGridHeight: 194 * tabletScaleFactor

    // 长按进入编辑状态的时间
    property int pressIntervalToEditable: 300

    // 分组名称最大的长度
    property int maxTitleLength: 14

    property real dpScale:  1.5
    readonly property real dp: Math.max(Screen.pixelDensity * 25.4 / 160 * dpScale, 1)

    property real defaultPixDensity: 3.611320754716981  //pixel density of my current screen
    property real scaleFactor: dp//Screen.pixelDensity / defaultPixDensity

    function dp(val) {
        return Math.round(val * (Screen.pixelDensity * 25.4 * Screen.devicePixelRatio / 160))
    }
}
