X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=24e4a5d104a94e435682381d00f14545c13de75c;hp=a28f4e84eca13fa6d6d3589bec84bb17ece29237;hb=fc81975a545211f3ccd3d25e266477adad2c9445;hpb=0789d47e81940cbbdf925466442380063a50ac05 diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index a28f4e84..24e4a5d1 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -27,6 +27,7 @@ #include "client.h" #include "chatitem.h" #include "chatline.h" +#include "columnhandleitem.h" #include "messagemodel.h" #include "networkmodel.h" #include "qtui.h" @@ -65,18 +66,18 @@ ChatItem &ChatLine::item(ChatLineModel::ColumnType column) { } } -qreal ChatLine::setGeometry(qreal width, qreal firstHandlePos, qreal secondHandlePos) { +qreal ChatLine::setGeometry(qreal width) { if(width != _width) prepareGeometryChange(); - qreal firstsep = QtUi::style()->firstColumnSeparator()/2; - qreal secondsep = QtUi::style()->secondColumnSeparator()/2; - _height = _contentsItem.setGeometry(width - secondHandlePos - secondsep); - _timestampItem.setGeometry(firstHandlePos - firstsep, _height); - _senderItem.setGeometry(secondHandlePos - firstHandlePos - (firstsep+secondsep), _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(firstHandlePos + firstsep, 0); - _contentsItem.setPos(secondHandlePos + secondsep, 0); + _senderItem.setPos(firstColumnHandle->sceneRight(), 0); + _contentsItem.setPos(secondColumnHandle->sceneRight(), 0); _width = width; return _height; @@ -132,7 +133,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);