mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
(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:
parent
8d2e48f944
commit
91dda9483b
2 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include "notebookpage.hpp"
|
#include "notebookpage.hpp"
|
||||||
#include "settingsmanager.hpp"
|
#include "settingsmanager.hpp"
|
||||||
|
|
||||||
|
#include <QFont>
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <boost/signals2.hpp>
|
#include <boost/signals2.hpp>
|
||||||
|
@ -165,6 +166,11 @@ ChatWidgetInput::~ChatWidgetInput()
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFont &ChatWidgetInput::getFont() const
|
||||||
|
{
|
||||||
|
return FontManager::getInstance().getFont(_font);
|
||||||
|
}
|
||||||
|
|
||||||
void ChatWidgetInput::refreshTheme()
|
void ChatWidgetInput::refreshTheme()
|
||||||
{
|
{
|
||||||
QPalette palette;
|
QPalette palette;
|
||||||
|
@ -174,6 +180,7 @@ void ChatWidgetInput::refreshTheme()
|
||||||
this->textLengthLabel.setPalette(palette);
|
this->textLengthLabel.setPalette(palette);
|
||||||
|
|
||||||
this->textInput.setStyleSheet(this->colorScheme.InputStyleSheet);
|
this->textInput.setStyleSheet(this->colorScheme.InputStyleSheet);
|
||||||
|
this->textInput.setFont(this->getFont());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWidgetInput::editTextChanged()
|
void ChatWidgetInput::editTextChanged()
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "fontmanager.hpp"
|
||||||
#include "resizingtextedit.hpp"
|
#include "resizingtextedit.hpp"
|
||||||
#include "widgets/basewidget.hpp"
|
#include "widgets/basewidget.hpp"
|
||||||
#include "widgets/chatwidgetheaderbutton.hpp"
|
#include "widgets/chatwidgetheaderbutton.hpp"
|
||||||
|
|
||||||
|
#include <QFont>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
@ -40,6 +42,8 @@ private:
|
||||||
ResizingTextEdit textInput;
|
ResizingTextEdit textInput;
|
||||||
QLabel textLengthLabel;
|
QLabel textLengthLabel;
|
||||||
ChatWidgetHeaderButton emotesLabel;
|
ChatWidgetHeaderButton emotesLabel;
|
||||||
|
FontManager::Type _font = FontManager::Small;
|
||||||
|
QFont &getFont() const;
|
||||||
QStringList prevMsg;
|
QStringList prevMsg;
|
||||||
unsigned int prevIndex = 0;
|
unsigned int prevIndex = 0;
|
||||||
virtual void refreshTheme() override;
|
virtual void refreshTheme() override;
|
||||||
|
|
Loading…
Reference in a new issue