Further simplify font label updating in settings dialog

This commit is contained in:
Rasmus Karlsson
2017-12-17 21:11:19 +01:00
parent 03958420be
commit 87182d078c
2 changed files with 10 additions and 15 deletions
+5 -10
View File
@@ -182,20 +182,15 @@ QVBoxLayout *SettingsDialog::createAppearanceTab()
{ {
auto &fontManager = FontManager::getInstance(); auto &fontManager = FontManager::getInstance();
fontManager.currentFontFamily.connect( auto UpdateFontFamilyLabel = [fontFamilyLabel, &fontManager](auto) {
[fontFamilyLabel, &fontManager](auto, auto) {
fontFamilyLabel->setText( fontFamilyLabel->setText(
QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " + QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " +
QString::number(fontManager.currentFontSize) + "pt"); QString::number(fontManager.currentFontSize) + "pt");
}, };
this->managedConnections);
fontManager.currentFontSize.connect( fontManager.currentFontFamily.connectSimple(UpdateFontFamilyLabel,
[fontFamilyLabel, &fontManager](auto, auto) { this->managedConnections);
fontFamilyLabel->setText( fontManager.currentFontSize.connectSimple(UpdateFontFamilyLabel,
QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " +
QString::number(fontManager.currentFontSize) + "pt");
},
this->managedConnections); this->managedConnections);
} }