Changeset View
Changeset View
Standalone View
Standalone View
src/controls/Heading.qml
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 50 | QQC2.Label { | |||
---|---|---|---|---|---|
60 | /** | 60 | /** | ||
61 | * step: int | 61 | * step: int | ||
62 | * adjust the point size in between a level and another. | 62 | * adjust the point size in between a level and another. | ||
63 | */ | 63 | */ | ||
64 | property int step: 2 | 64 | property int step: 2 | ||
65 | 65 | | |||
66 | lineHeight: 1.2 | 66 | lineHeight: 1.2 | ||
67 | font.pointSize: headerPointSize(level) | 67 | font.pointSize: headerPointSize(level) | ||
68 | font.weight: Font.Light | 68 | font.weight: level <= 4 ? Font.Light : Font.Normal | ||
69 | wrapMode: Text.WordWrap | 69 | wrapMode: Text.WordWrap | ||
70 | opacity: 0.8 | 70 | opacity: 0.8 | ||
71 | 71 | | |||
72 | function headerPointSize(l) { | 72 | function headerPointSize(l) { | ||
73 | var n = Theme.defaultFont.pointSize; | 73 | var n = Theme.defaultFont.pointSize; | ||
74 | var s; | 74 | var s; | ||
75 | if (l > 4) { | 75 | if (l > 4) { | ||
76 | s = n | 76 | s = n | ||
77 | } else if (l < 2) { | 77 | } else if (l < 2) { | ||
78 | s = n + (5*step) | 78 | s = n + (5*step) | ||
79 | } else { | 79 | } else { | ||
80 | s = n + ((5-level)*2) | 80 | s = n + ((5-level)*2) | ||
81 | } | 81 | } | ||
82 | return s; | 82 | return s; | ||
83 | } | 83 | } | ||
84 | } | 84 | } |