added basic alternating messages backgrounds

This commit is contained in:
fourtf
2018-05-06 14:38:23 +02:00
parent 12766f3b60
commit 34a58021bc
9 changed files with 49 additions and 26 deletions
+5
View File
@@ -356,6 +356,11 @@ void ChannelView::setChannel(ChannelPtr newChannel)
auto messageRef = new MessageLayout(message);
if (this->lastMessageHasAlternateBackground) {
messageRef->flags |= MessageLayout::AlternateBackground;
}
this->lastMessageHasAlternateBackground = !this->lastMessageHasAlternateBackground;
if (this->messages.pushBack(MessageLayoutPtr(messageRef), deleted)) {
if (!this->paused) {
if (this->scrollBar.isAtBottom()) {
+1
View File
@@ -85,6 +85,7 @@ private:
QTimer updateTimer;
bool updateQueued = false;
bool messageWasAdded = false;
bool lastMessageHasAlternateBackground = false;
bool paused = false;
QTimer pauseTimeout;
boost::optional<messages::MessageElement::Flags> overrideFlags;