Skip to content

Commit 00a2c30

Browse files
committed
Make more components respect the font size
1 parent 5b065e7 commit 00a2c30

4 files changed

Lines changed: 34 additions & 14 deletions

File tree

qml/components/DeviceScannerListWidget.qml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ Item {
122122
text: boxDevice.deviceAddress
123123
textFormat: Text.PlainText
124124
font.family: fontMonospace
125-
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
125+
font.pixelSize: Theme.componentFontSize
126126
elide: Text.ElideMiddle
127+
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
127128
}
128129

129130
RowLayout { // icons + name ////////////////////////////////////////////
@@ -151,6 +152,7 @@ Item {
151152

152153
text: (boxDevice.deviceName.length) ? boxDevice.deviceName_display : qsTr("Unavailable")
153154
textFormat: Text.PlainText
155+
font.pixelSize: Theme.componentFontSize
154156
elide: Text.ElideRight
155157
color: {
156158
if (boxDevice.connected || boxDevice.selected) return "white"
@@ -213,8 +215,9 @@ Item {
213215

214216
text: boxDevice.deviceManufacturer
215217
textFormat: Text.PlainText
216-
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
218+
font.pixelSize: Theme.componentFontSize
217219
elide: Text.ElideRight
220+
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
218221
}
219222

220223
RowLayout { // rssi ////////////////////////////////////////////////////
@@ -238,16 +241,17 @@ Item {
238241

239242
text: "-" + Math.abs(boxDevice.rssi)
240243
textFormat: Text.PlainText
241-
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
244+
font.pixelSize: Theme.componentFontSize - 2
242245
horizontalAlignment: Text.AlignRight
246+
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
243247
}
244248

245249
Text {
246250
anchors.verticalCenter: parent.verticalCenter
247251
text: qsTr("dBm")
248252
textFormat: Text.PlainText
253+
font.pixelSize: Theme.componentFontSize - 4
249254
color: (boxDevice.connected || boxDevice.selected) ? "#ddd" : Theme.colorSubText
250-
font.pixelSize: 12
251255
}
252256
}
253257

@@ -277,6 +281,7 @@ Item {
277281

278282
text: boxDevice && boxDevice.advInterval
279283
textFormat: Text.PlainText
284+
font.pixelSize: Theme.componentFontSize
280285
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
281286
}
282287

@@ -285,8 +290,8 @@ Item {
285290

286291
text: qsTr("ms")
287292
textFormat: Text.PlainText
293+
font.pixelSize: Theme.componentFontSize - 4
288294
color: (boxDevice.connected || boxDevice.selected) ? "#ddd" : Theme.colorSubText
289-
font.pixelSize: 12
290295
}
291296
}
292297
}
@@ -302,6 +307,7 @@ Item {
302307
boxDevice.lastSeen.toLocaleTimeString(locale, "hh:mm") :
303308
boxDevice.lastSeen.toLocaleString(locale, "dd/MM hh:mm")
304309
textFormat: Text.PlainText
310+
font.pixelSize: Theme.componentFontSize
305311
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
306312
}
307313
}
@@ -315,6 +321,7 @@ Item {
315321

316322
text: boxDevice.firstSeen.toLocaleString(locale, "dd/MM hh:mm")
317323
textFormat: Text.PlainText
324+
font.pixelSize: Theme.componentFontSize
318325
color: (boxDevice.connected || boxDevice.selected) ? "white" : Theme.colorText
319326
}
320327
}

qml/components/DeviceScannerTableWidget.qml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ DelegateChooser {
4646
text: address
4747
textFormat: Text.PlainText
4848
font.family: fontMonospace
49-
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
50-
verticalAlignment: Text.AlignVCenter
49+
font.pixelSize: Theme.componentFontSize
5150
elide: Text.ElideMiddle
51+
verticalAlignment: Text.AlignVCenter
52+
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
5253

5354
Rectangle { // background
5455
anchors.fill: parent
@@ -78,9 +79,10 @@ DelegateChooser {
7879

7980
text: name
8081
textFormat: Text.PlainText
81-
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
82+
font.pixelSize: Theme.componentFontSize
8283
elide: Text.ElideRight
8384
verticalAlignment: Text.AlignVCenter
85+
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
8486

8587
Rectangle { // background
8688
anchors.fill: parent
@@ -110,9 +112,10 @@ DelegateChooser {
110112

111113
text: manufacturer
112114
textFormat: Text.PlainText
113-
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
115+
font.pixelSize: Theme.componentFontSize
114116
elide: Text.ElideRight
115117
verticalAlignment: Text.AlignVCenter
118+
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
116119

117120
Rectangle { // background
118121
anchors.fill: parent
@@ -164,16 +167,17 @@ DelegateChooser {
164167
anchors.verticalCenter: parent.verticalCenter
165168
text: "-" + Math.abs(rssi).toFixed(0)
166169
textFormat: Text.PlainText
167-
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
170+
font.pixelSize: Theme.componentFontSize - 2
168171
horizontalAlignment: Text.AlignRight
172+
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
169173
}
170174

171175
Text {
172176
anchors.verticalCenter: parent.verticalCenter
173177
text: qsTr("dBm")
174178
textFormat: Text.PlainText
179+
font.pixelSize: Theme.componentFontSize - 4
175180
color: (pointer.connected || pointer.selected) ? "#ddd" : Theme.colorSubText
176-
font.pixelSize: 12
177181
}
178182

179183
RssiBar {
@@ -219,6 +223,7 @@ DelegateChooser {
219223

220224
text: interval
221225
textFormat: Text.PlainText
226+
font.pixelSize: Theme.componentFontSize
222227
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
223228
}
224229

@@ -227,8 +232,8 @@ DelegateChooser {
227232

228233
text: qsTr("ms")
229234
textFormat: Text.PlainText
235+
font.pixelSize: Theme.componentFontSize - 4
230236
color: (pointer.connected || pointer.selected) ? "#ddd" : Theme.colorSubText
231-
font.pixelSize: 12
232237
}
233238
}
234239
}
@@ -245,9 +250,10 @@ DelegateChooser {
245250
pointer.lastSeen.toLocaleTimeString(locale, "hh:mm") :
246251
pointer.lastSeen.toLocaleString(locale, "dd/MM hh:mm")
247252
textFormat: Text.PlainText
248-
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
253+
font.pixelSize: Theme.componentFontSize
249254
elide: Text.ElideRight
250255
verticalAlignment: Text.AlignVCenter
256+
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
251257

252258
Rectangle { // background
253259
anchors.fill: parent
@@ -276,9 +282,10 @@ DelegateChooser {
276282

277283
text: pointer.firstSeen.toLocaleString(locale, "dd/MM hh:mm")
278284
textFormat: Text.PlainText
279-
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
285+
font.pixelSize: Theme.componentFontSize
280286
elide: Text.ElideRight
281287
verticalAlignment: Text.AlignVCenter
288+
color: (pointer.connected || pointer.selected) ? "white" : Theme.colorText
282289

283290
Rectangle { // background
284291
anchors.fill: parent

thirdparty/ComponentLibrary/qml/generics/SelectorMenuColorfulItem.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ T.Button {
1414
leftPadding: 16
1515
rightPadding: 16
1616

17+
font.pixelSize: Theme.componentFontSize
18+
font.bold: false
19+
1720
focusPolicy: Qt.NoFocus
1821
hoverEnabled: enabled && !readOnly
1922

thirdparty/ComponentLibrary/qml/generics/SelectorMenuItem.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ T.Button {
1414
leftPadding: 16
1515
rightPadding: 16
1616

17+
font.pixelSize: Theme.componentFontSize
18+
font.bold: false
19+
1720
focusPolicy: Qt.NoFocus
1821
hoverEnabled: enabled && !readOnly
1922

0 commit comments

Comments
 (0)