From a39874414ce0837dbab9990830e8244a845c1bc3 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Mon, 30 Mar 2026 15:55:11 -0500 Subject: [PATCH] Add option to list all fonts, not just Monospace. --- src/SeerEditorConfigPage.cpp | 18 +++++++++++++++++- src/SeerEditorConfigPage.h | 1 + src/SeerEditorConfigPage.ui | 16 +++++++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/SeerEditorConfigPage.cpp b/src/SeerEditorConfigPage.cpp index 0327ece..20db973 100644 --- a/src/SeerEditorConfigPage.cpp +++ b/src/SeerEditorConfigPage.cpp @@ -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); diff --git a/src/SeerEditorConfigPage.h b/src/SeerEditorConfigPage.h index 2727bac..13c937c 100644 --- a/src/SeerEditorConfigPage.h +++ b/src/SeerEditorConfigPage.h @@ -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 (); diff --git a/src/SeerEditorConfigPage.ui b/src/SeerEditorConfigPage.ui index 8e51b1c..a624417 100644 --- a/src/SeerEditorConfigPage.ui +++ b/src/SeerEditorConfigPage.ui @@ -7,7 +7,7 @@ 0 0 660 - 703 + 861 @@ -43,6 +43,19 @@ + + + + Show only Mono Spaced fonts. + + + Mono + + + true + + + @@ -336,6 +349,7 @@ li.checked::marker { content: "\2612"; } <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Text</li> <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Assembly Text</li> <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Current Line</li></ul> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">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.</p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Syntax highlighting can be enabled or disabled. The list of suffixes for supported source files can be changed. For example, C/C++ source files:</p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&quot;.h|.cpp|.c&quot;</p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The tab size, in spaces, can be set to properly display source files that contain tab characters.</p>