fixed splits not redrawing after font changed

This commit is contained in:
2017-12-17 03:26:23 +01:00
parent 266ad36de3
commit 5cb33647dc
4 changed files with 19 additions and 6 deletions
+12 -5
View File
@@ -61,6 +61,10 @@ ChannelView::ChannelView(BaseWidget *parent)
this->goToBottom->getLabel().setText("Jump to bottom");
this->goToBottom->setVisible(false);
this->fontChangedConnection = FontManager::getInstance().fontChanged.connect([this] {
this->layoutMessages(); //
});
connect(goToBottom, &RippleEffectLabel::clicked, this,
[this] { QTimer::singleShot(180, [this] { this->scrollBar.scrollToBottom(); }); });
@@ -79,6 +83,7 @@ ChannelView::~ChannelView()
{
QObject::disconnect(&SettingsManager::getInstance(), &SettingsManager::wordTypeMaskChanged,
this, &ChannelView::wordTypeMaskChanged);
FontManager::getInstance().fontChanged.disconnect(this->fontChangedConnection);
}
void ChannelView::queueUpdate()
@@ -241,8 +246,9 @@ QString ChannelView::getSelectedText()
if (first) {
first = false;
bool isSingleWord = isSingleMessage && this->selection.max.charIndex - charIndex <
part.getCharacterLength();
bool isSingleWord =
isSingleMessage &&
this->selection.max.charIndex - charIndex < part.getCharacterLength();
if (isSingleWord) {
// return single word
@@ -519,9 +525,10 @@ void ChannelView::updateMessageBuffer(messages::MessageRef *messageRef, QPixmap
// this->selectionMax.messageIndex >= messageIndex) {
// painter.fillRect(buffer->rect(), QColor(24, 55, 25));
//} else {
painter.fillRect(buffer->rect(), (messageRef->getMessage()->getCanHighlightTab())
? this->colorScheme.ChatBackgroundHighlighted
: this->colorScheme.ChatBackground);
painter.fillRect(buffer->rect(),
(messageRef->getMessage()->getCanHighlightTab())
? this->colorScheme.ChatBackgroundHighlighted
: this->colorScheme.ChatBackground);
//}
// draw selection