(WIP) Use configured font for text input in ChatWidgetInput

Needs work - Doesn't currently change in same fashion as ChatWidget, changes are only apparent when you initialise or reintialise the object (e.g. when you close and open a new chat window). Just need to do some more investigation into how this is handled by other widgets.
This commit is contained in:
CLouDY 2017-08-28 21:48:30 +01:00
parent 8d2e48f944
commit 91dda9483b
2 changed files with 11 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#include "notebookpage.hpp"
#include "settingsmanager.hpp"
#include <QFont>
#include <QCompleter>
#include <QPainter>
#include <boost/signals2.hpp>
@ -165,6 +166,11 @@ ChatWidgetInput::~ChatWidgetInput()
*/
}
QFont &ChatWidgetInput::getFont() const
{
return FontManager::getInstance().getFont(_font);
}
void ChatWidgetInput::refreshTheme()
{
QPalette palette;
@ -174,6 +180,7 @@ void ChatWidgetInput::refreshTheme()
this->textLengthLabel.setPalette(palette);
this->textInput.setStyleSheet(this->colorScheme.InputStyleSheet);
this->textInput.setFont(this->getFont());
}
void ChatWidgetInput::editTextChanged()

View file

@ -1,9 +1,11 @@
#pragma once
#include "fontmanager.hpp"
#include "resizingtextedit.hpp"
#include "widgets/basewidget.hpp"
#include "widgets/chatwidgetheaderbutton.hpp"
#include <QFont>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
@ -40,6 +42,8 @@ private:
ResizingTextEdit textInput;
QLabel textLengthLabel;
ChatWidgetHeaderButton emotesLabel;
FontManager::Type _font = FontManager::Small;
QFont &getFont() const;
QStringList prevMsg;
unsigned int prevIndex = 0;
virtual void refreshTheme() override;