Changeset View
Changeset View
Standalone View
Standalone View
src/controls/Units.qml
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 30 | QtObject { | |||
---|---|---|---|---|---|
72 | property int smallSpacing: Math.floor(gridUnit/4) | 72 | property int smallSpacing: Math.floor(gridUnit/4) | ||
73 | 73 | | |||
74 | /** | 74 | /** | ||
75 | * units.largeSpacing is the amount of spacing that should be used inside bigger UI elements, | 75 | * units.largeSpacing is the amount of spacing that should be used inside bigger UI elements, | ||
76 | * for example between an icon and the corresponding text. Internally, this size depends on | 76 | * for example between an icon and the corresponding text. Internally, this size depends on | ||
77 | * the size of the default font as rendered on the screen, so it takes user-configured font | 77 | * the size of the default font as rendered on the screen, so it takes user-configured font | ||
78 | * size and DPI into account. | 78 | * size and DPI into account. | ||
79 | */ | 79 | */ | ||
80 | property int largeSpacing: gridUnit | 80 | property int largeSpacing: Math.floor(gridUnit/2) | ||
81 | 81 | | |||
82 | /** | 82 | /** | ||
83 | * The ratio between physical and device-independent pixels. This value does not depend on the \ | 83 | * The ratio between physical and device-independent pixels. This value does not depend on the \ | ||
84 | * size of the configured font. If you want to take font sizes into account when scaling elements, | 84 | * size of the configured font. If you want to take font sizes into account when scaling elements, | ||
85 | * use theme.mSize(theme.defaultFont), units.smallSpacing and units.largeSpacing. | 85 | * use theme.mSize(theme.defaultFont), units.smallSpacing and units.largeSpacing. | ||
86 | * The devicePixelRatio follows the definition of "device independent pixel" by Microsoft. | 86 | * The devicePixelRatio follows the definition of "device independent pixel" by Microsoft. | ||
87 | */ | 87 | */ | ||
88 | property real devicePixelRatio: Math.max(1, (fontMetrics.font.pixelSize / fontMetrics.font.pointSize)) | 88 | property real devicePixelRatio: Math.max(1, (fontMetrics.font.pixelSize / fontMetrics.font.pointSize)) | ||
Show All 33 Lines |