Changeset View
Changeset View
Standalone View
Standalone View
applets/weather/package/contents/ui/IconAndTextItem.qml
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 70 | Text { | |||
---|---|---|---|---|---|
71 | id: sizehelper | 71 | id: sizehelper | ||
72 | 72 | | |||
73 | font { | 73 | font { | ||
74 | family: label.font.family | 74 | family: label.font.family | ||
75 | weight: label.font.weight | 75 | weight: label.font.weight | ||
76 | italic: label.font.italic | 76 | italic: label.font.italic | ||
77 | pixelSize: iconAndTextRoot.vertical ? theme.mSize(theme.defaultFont).height * 2 : 1024 // random "big enough" size - this is used as a max pixelSize by the fontSizeMode | 77 | pixelSize: iconAndTextRoot.vertical ? theme.mSize(theme.defaultFont).height * 2 : 1024 // random "big enough" size - this is used as a max pixelSize by the fontSizeMode | ||
78 | } | 78 | } | ||
79 | minimumPixelSize: theme.mSize(theme.smallestFont).height | 79 | minimumPixelSize: theme.mSize(theme.smallestFont).height / 2 | ||
80 | fontSizeMode: iconAndTextRoot.vertical ? Text.HorizontalFit : Text.VerticalFit | 80 | fontSizeMode: iconAndTextRoot.vertical ? Text.HorizontalFit : Text.VerticalFit | ||
81 | wrapMode: Text.NoWrap | 81 | wrapMode: Text.NoWrap | ||
82 | 82 | | |||
83 | horizontalAlignment: Text.AlignHCenter | 83 | horizontalAlignment: Text.AlignHCenter | ||
84 | verticalAlignment: Text.AlignVCenter | 84 | verticalAlignment: Text.AlignVCenter | ||
85 | anchors { | 85 | anchors { | ||
86 | fill: parent | 86 | fill: parent | ||
87 | leftMargin: units.smallSpacing | 87 | leftMargin: units.smallSpacing | ||
88 | rightMargin: units.smallSpacing | 88 | rightMargin: units.smallSpacing | ||
89 | } | 89 | } | ||
90 | visible: false | 90 | visible: false | ||
91 | 91 | | |||
92 | // pattern to reserve some constant space TODO: improve and take formatting/i18n into account | 92 | // pattern to reserve some constant space TODO: improve and take formatting/i18n into account | ||
93 | text: "888.8° X" | 93 | text: "888.8° X" | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | PlasmaComponents.Label { | 96 | PlasmaComponents.Label { | ||
97 | id: label | 97 | id: label | ||
98 | 98 | | |||
99 | font { | 99 | font { | ||
100 | weight: Font.Normal | 100 | weight: Font.Normal | ||
101 | pixelSize: 1024 | 101 | pixelSize: 1024 | ||
102 | pointSize: 0 // we need to unset pointSize otherwise it breaks the Text.Fit size mode | 102 | pointSize: 0 // we need to unset pointSize otherwise it breaks the Text.Fit size mode | ||
103 | } | 103 | } | ||
104 | minimumPixelSize: theme.mSize(theme.smallestFont).height | 104 | minimumPixelSize: theme.mSize(theme.smallestFont).height / 2 | ||
105 | fontSizeMode: Text.Fit | 105 | fontSizeMode: Text.Fit | ||
106 | wrapMode: Text.NoWrap | 106 | wrapMode: Text.NoWrap | ||
107 | 107 | | |||
108 | height: 0 | 108 | height: 0 | ||
109 | width: 0 | 109 | width: 0 | ||
110 | verticalAlignment: Text.AlignVCenter | 110 | verticalAlignment: Text.AlignVCenter | ||
111 | horizontalAlignment: Text.AlignHCenter | 111 | horizontalAlignment: Text.AlignHCenter | ||
112 | anchors { | 112 | anchors { | ||
113 | fill: parent | 113 | fill: parent | ||
114 | leftMargin: units.smallSpacing | 114 | leftMargin: units.smallSpacing | ||
115 | rightMargin: units.smallSpacing | 115 | rightMargin: units.smallSpacing | ||
116 | } | 116 | } | ||
117 | } | 117 | } | ||
118 | } | 118 | } | ||
119 | } | 119 | } |