From f26cfdd92bbce2ba469743bf3811b0c581010693 Mon Sep 17 00:00:00 2001 From: CLouDY Date: Tue, 29 Aug 2017 18:59:16 +0100 Subject: [PATCH] (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 --- src/widgets/chatwidgetinput.cpp | 9 ++------- src/widgets/chatwidgetinput.hpp | 4 ---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/widgets/chatwidgetinput.cpp b/src/widgets/chatwidgetinput.cpp index cb68b7e31..202403021 100644 --- a/src/widgets/chatwidgetinput.cpp +++ b/src/widgets/chatwidgetinput.cpp @@ -7,7 +7,6 @@ #include "notebookpage.hpp" #include "settingsmanager.hpp" -#include #include #include #include @@ -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 *) diff --git a/src/widgets/chatwidgetinput.hpp b/src/widgets/chatwidgetinput.hpp index 76be1f50f..a0fdc09bf 100644 --- a/src/widgets/chatwidgetinput.hpp +++ b/src/widgets/chatwidgetinput.hpp @@ -1,11 +1,9 @@ #pragma once -#include "fontmanager.hpp" #include "resizingtextedit.hpp" #include "widgets/basewidget.hpp" #include "widgets/chatwidgetheaderbutton.hpp" -#include #include #include #include @@ -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;