Added ability to change the font size.
It mostly works. It's a little wonky sometimes but it will mostly change all fonts in the application to the size you set.
This commit is contained in:
@@ -6,6 +6,13 @@ int main(int argc, char *argv[])
|
||||
QApplication a(argc, argv);
|
||||
|
||||
MainWindow w;
|
||||
|
||||
QSettings settings;
|
||||
int fontSize = settings.value("Main/FontSize", 9).toUInt();
|
||||
QFont sysFont = QFont(); //get default font
|
||||
sysFont.setPointSize(fontSize);
|
||||
a.setFont(sysFont);
|
||||
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
|
||||
@@ -29,6 +29,8 @@ MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
|
||||
ui->spinPlaybackSpeed->setValue(settings->value("Playback/DefSpeed", 5).toInt());
|
||||
ui->lineClockFormat->setText(settings->value("Main/TimeFormat", "MMM-dd HH:mm:ss.zzz").toString());
|
||||
|
||||
ui->spinFontSize->setValue(settings->value("Main/FontSize", ui->cbDisplayHex->font().pointSize()).toUInt());
|
||||
|
||||
bool secondsMode = settings->value("Main/TimeSeconds", false).toBool();
|
||||
bool clockMode = settings->value("Main/TimeClock", false).toBool();
|
||||
if (clockMode)
|
||||
@@ -87,6 +89,7 @@ void MainSettingsDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
removeEventFilter(this);
|
||||
updateSettings();
|
||||
settings->sync();
|
||||
}
|
||||
|
||||
@@ -126,6 +129,7 @@ void MainSettingsDialog::updateSettings()
|
||||
settings->setValue("Main/UseFiltered", ui->cbUseFiltered->isChecked());
|
||||
settings->setValue("Main/UseOpenGL", ui->cbUseOpenGL->isChecked());
|
||||
settings->setValue("Main/TimeFormat", ui->lineClockFormat->text());
|
||||
settings->setValue("Main/FontSize", ui->spinFontSize->value());
|
||||
|
||||
settings->sync();
|
||||
emit updatedSettings();
|
||||
|
||||
@@ -284,6 +284,10 @@ void MainWindow::readSettings()
|
||||
{
|
||||
ui->cbAutoScroll->setChecked(true);
|
||||
}
|
||||
int fontSize = settings.value("Main/FontSize", 9).toUInt();
|
||||
QFont newFont = QFont(ui->canFramesView->font());
|
||||
newFont.setPointSize(fontSize);
|
||||
ui->canFramesView->setFont(newFont);
|
||||
|
||||
readUpdateableSettings();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>743</height>
|
||||
<height>850</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -123,6 +123,28 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_7">
|
||||
<property name="title">
|
||||
<string>Font Size</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinFontSize">
|
||||
<property name="minimum">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>9</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user