X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=c1c98da62babd4f9711fd4846d4d8d7dfab82bc4;hp=3c68c4b0549e844e2046a3a8df9af68a013a66f6;hb=66c5feaf7c9f480f06dfb45df2cf54e44c8b487b;hpb=86a1220cc45c658954860e6dedbc18e38986ca94 diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index 3c68c4b0..c1c98da6 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -105,20 +105,20 @@ void ChatLine::setSecondColumn(const qreal &senderWidth, const qreal &contentsWi void ChatLine::setGeometryByWidth(const qreal &width, const qreal &contentsWidth, qreal &linePos) { qreal height = _contentsItem.setGeometryByWidth(contentsWidth); linePos -= height; - bool needGeometryChange = linePos == pos().y(); + bool needGeometryChange = (height != _height || width != _width); - if(needGeometryChange) { + if(height != _height) { _timestampItem.prepareGeometryChange(); + _timestampItem.setHeight(height); _senderItem.prepareGeometryChange(); + _senderItem.setHeight(height); } - _timestampItem.setHeight(height); - _senderItem.setHeight(height); - if(needGeometryChange) + if(needGeometryChange) { prepareGeometryChange(); - - _height = height; - _width = width; + _height = height; + _width = width; + } setPos(0, linePos); // set pos is _very_ cheap if nothing changes. } @@ -187,7 +187,7 @@ void ChatLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, MsgId lastSeenMsgId = Client::networkModel()->lastSeenMarkerMsgId(bufferId); if(lastSeenMsgId < myMsgId && lastSeenMsgId >= prevMsgId) { QLinearGradient gradient(0, 0, 0, contentsItem().fontMetrics()->lineSpacing()); - gradient.setColorAt(0, QtUi::style()->markerLineBrush().color()); // FIXME: Use full (gradient?) brush instead of just the color + gradient.setColorAt(0, QtUi::style()->brush(UiStyle::MarkerLine).color()); // FIXME: Use full (gradient?) brush instead of just the color gradient.setColorAt(0.1, Qt::transparent); painter->fillRect(boundingRect(), gradient); }