From 87182d078c991c0b153dbbd440b672d0256c704d Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 17 Dec 2017 21:11:19 +0100 Subject: [PATCH] Further simplify font label updating in settings dialog --- lib/settings | 2 +- src/widgets/settingsdialog.cpp | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/settings b/lib/settings index a8c167976..7ef470459 160000 --- a/lib/settings +++ b/lib/settings @@ -1 +1 @@ -Subproject commit a8c167976e907d8caa19f921d7a4984c6658a2a9 +Subproject commit 7ef4704596cbcf37784ffd51e28a1203298654e9 diff --git a/src/widgets/settingsdialog.cpp b/src/widgets/settingsdialog.cpp index 174f460f4..4c4bd36f5 100644 --- a/src/widgets/settingsdialog.cpp +++ b/src/widgets/settingsdialog.cpp @@ -182,21 +182,16 @@ QVBoxLayout *SettingsDialog::createAppearanceTab() { auto &fontManager = FontManager::getInstance(); - fontManager.currentFontFamily.connect( - [fontFamilyLabel, &fontManager](auto, auto) { - fontFamilyLabel->setText( - QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " + - QString::number(fontManager.currentFontSize) + "pt"); - }, - this->managedConnections); + auto UpdateFontFamilyLabel = [fontFamilyLabel, &fontManager](auto) { + fontFamilyLabel->setText( + QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " + + QString::number(fontManager.currentFontSize) + "pt"); + }; - fontManager.currentFontSize.connect( - [fontFamilyLabel, &fontManager](auto, auto) { - fontFamilyLabel->setText( - QString::fromStdString(fontManager.currentFontFamily.getValue()) + ", " + - QString::number(fontManager.currentFontSize) + "pt"); - }, - this->managedConnections); + fontManager.currentFontFamily.connectSimple(UpdateFontFamilyLabel, + this->managedConnections); + fontManager.currentFontSize.connectSimple(UpdateFontFamilyLabel, + this->managedConnections); } fontButton->connect(fontButton, &QPushButton::clicked, []() {