Add option to list all fonts, not just Monospace.

This commit is contained in:
Ernie Pasveer
2026-03-30 15:55:11 -05:00
parent de00e0cb19
commit a39874414c
3 changed files with 33 additions and 2 deletions
+17 -1
View File
@@ -21,6 +21,7 @@ SeerEditorConfigPage::SeerEditorConfigPage(QWidget* parent) : QWidget(parent) {
//
// Connect things.
QObject::connect(fontMonoRadioButton, &QRadioButton::clicked, this, &SeerEditorConfigPage::handleFontMonoChanged);
QObject::connect(fontSizeComboBox, &QComboBox::currentTextChanged, this, &SeerEditorConfigPage::handleFontSizeChanged);
QObject::connect(fontNameComboBox, &QFontComboBox::currentFontChanged, this, &SeerEditorConfigPage::handleFontChanged);
QObject::connect(fontDialogButton, &QToolButton::clicked, this, &SeerEditorConfigPage::handleFontDialog);
@@ -199,6 +200,15 @@ void SeerEditorConfigPage::reset () {
setAutoSourceReload(false);
}
void SeerEditorConfigPage::handleFontMonoChanged () {
if (fontMonoRadioButton->isChecked()) {
fontNameComboBox->setFontFilters(QFontComboBox::MonospacedFonts);
}else{
fontNameComboBox->setFontFilters(QFontComboBox::AllFonts);
}
}
void SeerEditorConfigPage::handleFontSizeChanged (const QString& text) {
// Convert the text size to a number.
@@ -246,7 +256,13 @@ void SeerEditorConfigPage::handleFontDialog () {
bool ok;
QFont font = QFontDialog::getFont(&ok, _font, this, "Select a font for the editors", QFontDialog::MonospacedFonts);
QFont font;
if (fontMonoRadioButton->isChecked()) {
font = QFontDialog::getFont(&ok, _font, this, "Select a font for the editors", QFontDialog::MonospacedFonts);
}else{
font = QFontDialog::getFont(&ok, _font, this, "Select a font for the editors");
}
if (ok) {
handleFontChanged(font);
+1
View File
@@ -39,6 +39,7 @@ class SeerEditorConfigPage : public QWidget, public Ui::SeerEditorConfigPage {
void reset ();
protected slots:
void handleFontMonoChanged ();
void handleFontSizeChanged (const QString& text);
void handleFontChanged (const QFont& font);
void handleFontDialog ();
+15 -1
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>660</width>
<height>703</height>
<height>861</height>
</rect>
</property>
<property name="windowTitle">
@@ -43,6 +43,19 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="fontMonoRadioButton">
<property name="toolTip">
<string>Show only Mono Spaced fonts.</string>
</property>
<property name="text">
<string>Mono</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
@@ -336,6 +349,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Text&lt;/li&gt;
&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Assembly Text&lt;/li&gt;
&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Current Line&lt;/li&gt;&lt;/ul&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A note about fonts. Sometimes Qt will not list some Mono Spaced fonts even though they are. If this is the case for you, disable the Mono button. All fonts will then be listed.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Syntax highlighting can be enabled or disabled. The list of suffixes for supported source files can be changed. For example, C/C++ source files:&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&amp;quot;.h|.cpp|.c&amp;quot;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The tab size, in spaces, can be set to properly display source files that contain tab characters.&lt;/p&gt;