(WIP) Removed old font changing logic for input text

All that needs doing is making it so that the input text font changes at exactly the same time as the chat messages font does, this is probably to do with focus
This commit is contained in:
CLouDY 2017-08-29 18:59:16 +01:00
parent ad1694234d
commit f26cfdd92b
2 changed files with 2 additions and 11 deletions

View file

@ -7,7 +7,6 @@
#include "notebookpage.hpp"
#include "settingsmanager.hpp"
#include <QFont>
#include <QCompleter>
#include <QPainter>
#include <boost/signals2.hpp>
@ -166,11 +165,6 @@ ChatWidgetInput::~ChatWidgetInput()
*/
}
QFont &ChatWidgetInput::getFont() const
{
return FontManager::getInstance().getFont(_font);
}
void ChatWidgetInput::refreshTheme()
{
QPalette palette;
@ -180,7 +174,6 @@ void ChatWidgetInput::refreshTheme()
this->textLengthLabel.setPalette(palette);
this->textInput.setStyleSheet(this->colorScheme.InputStyleSheet);
this->textInput.setFont(this->getFont());
}
void ChatWidgetInput::editTextChanged()
@ -204,6 +197,8 @@ void ChatWidgetInput::paintEvent(QPaintEvent *)
painter.fillRect(this->rect(), this->colorScheme.ChatInputBackground);
painter.setPen(this->colorScheme.ChatInputBorder);
painter.drawRect(0, 0, this->width() - 1, this->height() - 1);
this->textInput.setFont(textInput.getFont());
}
void ChatWidgetInput::resizeEvent(QResizeEvent *)

View file

@ -1,11 +1,9 @@
#pragma once
#include "fontmanager.hpp"
#include "resizingtextedit.hpp"
#include "widgets/basewidget.hpp"
#include "widgets/chatwidgetheaderbutton.hpp"
#include <QFont>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
@ -42,8 +40,6 @@ 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;