mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
fix: preserve font size when changing font (#369)
This commit is contained in:
parent
5895f9f590
commit
afee4d54fe
@ -147,7 +147,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
DS_cores);
|
||||
|
||||
if (!NekoGui::dataStore->font.isEmpty()) {
|
||||
qApp->setFont(NekoGui::dataStore->font);
|
||||
auto font = qApp->font();
|
||||
font.setFamily(NekoGui::dataStore->font);
|
||||
qApp->setFont(font);
|
||||
}
|
||||
if (NekoGui::dataStore->font_size != 0) {
|
||||
auto font = qApp->font();
|
||||
|
||||
@ -52,9 +52,11 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
|
||||
connect(ui->language, &QComboBox::currentIndexChanged, this, [=](int index) {
|
||||
CACHE.needRestart = true;
|
||||
});
|
||||
connect(ui->font, &QComboBox::currentTextChanged, this, [=](const QString &font) {
|
||||
connect(ui->font, &QComboBox::currentTextChanged, this, [=](const QString &fontName) {
|
||||
auto font = qApp->font();
|
||||
font.setFamily(fontName);
|
||||
qApp->setFont(font);
|
||||
NekoGui::dataStore->font = font;
|
||||
NekoGui::dataStore->font = fontName;
|
||||
NekoGui::dataStore->Save();
|
||||
adjustSize();
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user