From 7f80e64e7d512a072e66c02fb8d798e3455b9554 Mon Sep 17 00:00:00 2001 From: fourtf Date: Sun, 17 Dec 2017 20:48:15 +0100 Subject: [PATCH] current font in settings format now reads "fontname, fontsize pt" --- src/widgets/settingsdialog.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/widgets/settingsdialog.cpp b/src/widgets/settingsdialog.cpp index fed1f41fe..174f460f4 100644 --- a/src/widgets/settingsdialog.cpp +++ b/src/widgets/settingsdialog.cpp @@ -173,26 +173,28 @@ QVBoxLayout *SettingsDialog::createAppearanceTab() auto combo = new QComboBox(); auto fontLayout = new QHBoxLayout(); - auto fontFamilyLabel = new QLabel("Current font family"); - auto fontSizeLabel = new QLabel("Current font size"); + auto fontFamilyLabel = new QLabel("font family, size"); auto fontButton = new QPushButton("Select"); fontLayout->addWidget(fontButton); fontLayout->addWidget(fontFamilyLabel); - fontLayout->addWidget(fontSizeLabel); { auto &fontManager = FontManager::getInstance(); fontManager.currentFontFamily.connect( - [fontFamilyLabel](const std::string &newValue, auto) { - fontFamilyLabel->setText(QString::fromStdString(newValue)); // + [fontFamilyLabel, &fontManager](auto, auto) { + fontFamilyLabel->setText( + QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " + + QString::number(fontManager.currentFontSize) + "pt"); }, this->managedConnections); fontManager.currentFontSize.connect( - [fontSizeLabel](const int &newValue, auto) { - fontSizeLabel->setText(QString(QString::number(newValue))); // + [fontFamilyLabel, &fontManager](auto, auto) { + fontFamilyLabel->setText( + QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " + + QString::number(fontManager.currentFontSize) + "pt"); }, this->managedConnections); }