Skip to content

Commit 2e386cd

Browse files
committed
qt: Choose monospaced font in C++ code rather in *.ui file
This change makes macOS choose the correct monospaced font.
1 parent 564e1ab commit 2e386cd

File tree

2 files changed

+11
-56
lines changed

2 files changed

+11
-56
lines changed

src/qt/forms/overviewpage.ui

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,6 @@
116116
</property>
117117
<item row="2" column="2">
118118
<widget class="QLabel" name="labelWatchPending">
119-
<property name="font">
120-
<font>
121-
<family>Monospace</family>
122-
<weight>75</weight>
123-
<bold>true</bold>
124-
</font>
125-
</property>
126119
<property name="cursor">
127120
<cursorShape>IBeamCursor</cursorShape>
128121
</property>
@@ -142,13 +135,6 @@
142135
</item>
143136
<item row="2" column="1">
144137
<widget class="QLabel" name="labelUnconfirmed">
145-
<property name="font">
146-
<font>
147-
<family>Monospace</family>
148-
<weight>75</weight>
149-
<bold>true</bold>
150-
</font>
151-
</property>
152138
<property name="cursor">
153139
<cursorShape>IBeamCursor</cursorShape>
154140
</property>
@@ -168,13 +154,6 @@
168154
</item>
169155
<item row="3" column="2">
170156
<widget class="QLabel" name="labelWatchImmature">
171-
<property name="font">
172-
<font>
173-
<family>Monospace</family>
174-
<weight>75</weight>
175-
<bold>true</bold>
176-
</font>
177-
</property>
178157
<property name="cursor">
179158
<cursorShape>IBeamCursor</cursorShape>
180159
</property>
@@ -227,13 +206,6 @@
227206
</item>
228207
<item row="3" column="1">
229208
<widget class="QLabel" name="labelImmature">
230-
<property name="font">
231-
<font>
232-
<family>Monospace</family>
233-
<weight>75</weight>
234-
<bold>true</bold>
235-
</font>
236-
</property>
237209
<property name="cursor">
238210
<cursorShape>IBeamCursor</cursorShape>
239211
</property>
@@ -273,13 +245,6 @@
273245
</item>
274246
<item row="5" column="1">
275247
<widget class="QLabel" name="labelTotal">
276-
<property name="font">
277-
<font>
278-
<family>Monospace</family>
279-
<weight>75</weight>
280-
<bold>true</bold>
281-
</font>
282-
</property>
283248
<property name="cursor">
284249
<cursorShape>IBeamCursor</cursorShape>
285250
</property>
@@ -299,13 +264,6 @@
299264
</item>
300265
<item row="5" column="2">
301266
<widget class="QLabel" name="labelWatchTotal">
302-
<property name="font">
303-
<font>
304-
<family>Monospace</family>
305-
<weight>75</weight>
306-
<bold>true</bold>
307-
</font>
308-
</property>
309267
<property name="cursor">
310268
<cursorShape>IBeamCursor</cursorShape>
311269
</property>
@@ -342,13 +300,6 @@
342300
</item>
343301
<item row="1" column="1">
344302
<widget class="QLabel" name="labelBalance">
345-
<property name="font">
346-
<font>
347-
<family>Monospace</family>
348-
<weight>75</weight>
349-
<bold>true</bold>
350-
</font>
351-
</property>
352303
<property name="cursor">
353304
<cursorShape>IBeamCursor</cursorShape>
354305
</property>
@@ -368,13 +319,6 @@
368319
</item>
369320
<item row="1" column="2">
370321
<widget class="QLabel" name="labelWatchAvailable">
371-
<property name="font">
372-
<font>
373-
<family>Monospace</family>
374-
<weight>75</weight>
375-
<bold>true</bold>
376-
</font>
377-
</property>
378322
<property name="cursor">
379323
<cursorShape>IBeamCursor</cursorShape>
380324
</property>

src/qt/overviewpage.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
141141
showOutOfSyncWarning(true);
142142
connect(ui->labelWalletStatus, &QPushButton::clicked, this, &OverviewPage::handleOutOfSyncWarningClicks);
143143
connect(ui->labelTransactionsStatus, &QPushButton::clicked, this, &OverviewPage::handleOutOfSyncWarningClicks);
144+
145+
QFont f = GUIUtil::fixedPitchFont();
146+
f.setWeight(QFont::Bold);
147+
ui->labelBalance->setFont(f);
148+
ui->labelUnconfirmed->setFont(f);
149+
ui->labelImmature->setFont(f);
150+
ui->labelTotal->setFont(f);
151+
ui->labelWatchAvailable->setFont(f);
152+
ui->labelWatchPending->setFont(f);
153+
ui->labelWatchImmature->setFont(f);
154+
ui->labelWatchTotal->setFont(f);
144155
}
145156

146157
void OverviewPage::handleTransactionClicked(const QModelIndex &index)

0 commit comments

Comments
 (0)