diff --git a/src/singletons/thememanager.cpp b/src/singletons/thememanager.cpp index 936ba8d1f..348afd837 100644 --- a/src/singletons/thememanager.cpp +++ b/src/singletons/thememanager.cpp @@ -140,7 +140,7 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier) this->messages.textColors.system = QColor(140, 127, 127); this->messages.backgrounds.regular = splits.background; - this->messages.backgrounds.alternate = getColor(0, sat, 0.96); + this->messages.backgrounds.alternate = getColor(0, sat, 0.93); this->messages.backgrounds.highlighted = blendColors(themeColor, this->messages.backgrounds.regular, 0.8); // this->messages.backgrounds.resub diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index be188c913..8a599a13f 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -277,26 +277,26 @@ QString ChannelView::getSelectedText() messages::LimitedQueueSnapshot messagesSnapshot = this->getMessagesSnapshot(); - Selection selection = this->selection; + Selection _selection = this->selection; - if (selection.isEmpty()) { + if (_selection.isEmpty()) { return result; } - qDebug() << "xd >>>>"; - for (int msg = selection.selectionMin.messageIndex; msg <= selection.selectionMax.messageIndex; - msg++) { + qDebug() << "xd >"; + for (int msg = _selection.selectionMin.messageIndex; + msg <= _selection.selectionMax.messageIndex; msg++) { MessageLayoutPtr layout = messagesSnapshot[msg]; int from = - msg == selection.selectionMin.messageIndex ? selection.selectionMin.charIndex : 0; - int to = msg == selection.selectionMax.messageIndex ? selection.selectionMax.charIndex - : layout->getLastCharacterIndex() + 1; + msg == _selection.selectionMin.messageIndex ? _selection.selectionMin.charIndex : 0; + int to = msg == _selection.selectionMax.messageIndex ? _selection.selectionMax.charIndex + : layout->getLastCharacterIndex() + 1; qDebug() << "from:" << from << ", to:" << to; layout->addSelectionText(result, from, to); } - qDebug() << "xd <<<<"; + qDebug() << "xd <"; return result; } @@ -430,6 +430,9 @@ void ChannelView::setChannel(ChannelPtr newChannel) this->messageReplacedConnection = newChannel->messageReplaced.connect([this](size_t index, MessagePtr replacement) { MessageLayoutPtr newItem(new MessageLayout(replacement)); + if (this->messages.getSnapshot()[index]->flags & MessageLayout::AlternateBackground) { + newItem->flags |= MessageLayout::AlternateBackground; + } this->scrollBar.replaceHighlight(index, replacement->getScrollBarHighlight()); @@ -444,6 +447,11 @@ void ChannelView::setChannel(ChannelPtr newChannel) auto messageRef = new MessageLayout(snapshot[i]); + if (this->lastMessageHasAlternateBackground) { + messageRef->flags |= MessageLayout::AlternateBackground; + } + this->lastMessageHasAlternateBackground = !this->lastMessageHasAlternateBackground; + this->messages.pushBack(MessageLayoutPtr(messageRef), deleted); }