X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=1a8501c7316840b1f4a3c8e7159b2aa55ba998ae;hb=ba934ceb1bfe30d01d5fb5c072c3197f8080be04;hp=c09bdee01626354b356c8b79214f2f336b9f2aac;hpb=17a68937d25404ddb804f443629313a7c873dbe1;p=quassel.git diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index c09bdee0..1a8501c7 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -27,10 +27,12 @@ #include "client.h" #include "chatitem.h" #include "chatline.h" +#include "columnhandleitem.h" #include "messagemodel.h" #include "networkmodel.h" #include "qtui.h" #include "qtuisettings.h" +#include "qtuistyle.h" ChatLine::ChatLine(int row, QAbstractItemModel *model, QGraphicsItem *parent) : QGraphicsItem(parent), @@ -68,15 +70,15 @@ ChatItem &ChatLine::item(ChatLineModel::ColumnType column) { qreal ChatLine::setGeometry(qreal width) { if(width != _width) prepareGeometryChange(); - QRectF firstColHandleRect = chatScene()->firstColumnHandleRect(); - QRectF secondColHandleRect = chatScene()->secondColumnHandleRect(); - _height = _contentsItem.setGeometry(width - secondColHandleRect.right()); - _timestampItem.setGeometry(firstColHandleRect.left(), _height); - _senderItem.setGeometry(secondColHandleRect.left() - firstColHandleRect.right(), _height); + ColumnHandleItem *firstColumnHandle = chatScene()->firstColumnHandle(); + ColumnHandleItem *secondColumnHandle = chatScene()->secondColumnHandle(); + _height = _contentsItem.setGeometry(width - secondColumnHandle->sceneRight()); + _timestampItem.setGeometry(firstColumnHandle->sceneLeft(), _height); + _senderItem.setGeometry(secondColumnHandle->sceneLeft() - firstColumnHandle->sceneRight(), _height); - _senderItem.setPos(firstColHandleRect.right(), 0); - _contentsItem.setPos(secondColHandleRect.right(), 0); + _senderItem.setPos(firstColumnHandle->sceneRight(), 0); + _contentsItem.setPos(secondColumnHandle->sceneRight(), 0); _width = width; return _height; @@ -132,7 +134,7 @@ void ChatLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, if(!(flags & Message::Self)) { BufferId bufferId = model_->data(prevRowIdx, MessageModel::BufferIdRole).value(); if(msgId == Client::networkModel()->lastSeenMsgId(bufferId) && chatScene()->isSingleBufferScene()) { - QtUiSettings s("QtUiStyle/Colors"); + QtUiStyleSettings s("Colors"); QLinearGradient gradient(0, 0, 0, height()); gradient.setColorAt(0, s.value("newMsgMarkerFG", QColor(Qt::red)).value()); gradient.setColorAt(0.1, Qt::transparent);