mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Add option to list all fonts, not just Monospace.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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: "\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>
|
||||
|
||||
Reference in New Issue
Block a user