current font in settings format

now reads "fontname, fontsize pt"
This commit is contained in:
fourtf 2017-12-17 20:48:15 +01:00
parent 54ed42f884
commit 7f80e64e7d

View file

@ -173,26 +173,28 @@ QVBoxLayout *SettingsDialog::createAppearanceTab()
auto combo = new QComboBox(); auto combo = new QComboBox();
auto fontLayout = new QHBoxLayout(); auto fontLayout = new QHBoxLayout();
auto fontFamilyLabel = new QLabel("Current font family"); auto fontFamilyLabel = new QLabel("font family, size");
auto fontSizeLabel = new QLabel("Current font size");
auto fontButton = new QPushButton("Select"); auto fontButton = new QPushButton("Select");
fontLayout->addWidget(fontButton); fontLayout->addWidget(fontButton);
fontLayout->addWidget(fontFamilyLabel); fontLayout->addWidget(fontFamilyLabel);
fontLayout->addWidget(fontSizeLabel);
{ {
auto &fontManager = FontManager::getInstance(); auto &fontManager = FontManager::getInstance();
fontManager.currentFontFamily.connect( fontManager.currentFontFamily.connect(
[fontFamilyLabel](const std::string &newValue, auto) { [fontFamilyLabel, &fontManager](auto, auto) {
fontFamilyLabel->setText(QString::fromStdString(newValue)); // fontFamilyLabel->setText(
QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " +
QString::number(fontManager.currentFontSize) + "pt");
}, },
this->managedConnections); this->managedConnections);
fontManager.currentFontSize.connect( fontManager.currentFontSize.connect(
[fontSizeLabel](const int &newValue, auto) { [fontFamilyLabel, &fontManager](auto, auto) {
fontSizeLabel->setText(QString(QString::number(newValue))); // fontFamilyLabel->setText(
QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " +
QString::number(fontManager.currentFontSize) + "pt");
}, },
this->managedConnections); this->managedConnections);
} }