mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
current font in settings format
now reads "fontname, fontsize pt"
This commit is contained in:
parent
54ed42f884
commit
7f80e64e7d
1 changed files with 9 additions and 7 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue