Clean up font management

Default to b.userName instead of message->account()
Made font updatable in the Settings dialog with a font dialog
More work on subscription badge loading

Known issues:
  - Font isn't updated in a split until a new message is written in that split
  - When font/font size is changed, old messages don't have their size updated causing weird layout of old messages
This commit is contained in:
Rasmus Karlsson
2017-06-17 11:37:13 +02:00
parent d2cbef9dff
commit 1ecc6ff612
6 changed files with 204 additions and 104 deletions
+16
View File
@@ -7,6 +7,7 @@
#include <QComboBox>
#include <QDebug>
#include <QFile>
#include <QFontDialog>
#include <QFormLayout>
#include <QGroupBox>
#include <QLabel>
@@ -108,7 +109,22 @@ void SettingsDialog::addTabs()
auto form = new QFormLayout();
auto combo = new QComboBox();
auto slider = new QSlider(Qt::Horizontal);
auto font = new QPushButton("select");
font->connect(font, &QPushButton::clicked, []() {
auto fontManager = FontManager::getInstance();
QFontDialog dialog(fontManager.getFont(FontManager::Medium));
dialog.connect(&dialog, &QFontDialog::fontSelected, [&dialog](const QFont &font) {
auto fontManager = FontManager::getInstance();
fontManager.currentFontFamily = font.family().toStdString();
fontManager.currentFontSize = font.pointSize();
});
dialog.show();
dialog.exec();
});
auto compactTabs = createCheckbox("Hide tab X", settings.hideTabX);
auto hidePreferencesButton = createCheckbox("Hide preferences button (ctrl+p to show)",
settings.hidePreferencesButton);