X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=c09bdee01626354b356c8b79214f2f336b9f2aac;hb=0f16a547d17c536cc567bfb2746824bfca3424cd;hp=94820d631ad5313bcaf793438570026aaee14321;hpb=603763515d61fc1cd3febbfd7c3268d5216df768;p=quassel.git diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index 94820d63..c09bdee0 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -65,18 +65,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; + QRectF firstColHandleRect = chatScene()->firstColumnHandleRect(); + QRectF secondColHandleRect = chatScene()->secondColumnHandleRect(); - _height = _contentsItem.setGeometry(width - secondHandlePos - secondsep); - _timestampItem.setGeometry(firstHandlePos - firstsep, _height); - _senderItem.setGeometry(secondHandlePos - firstHandlePos - (firstsep+secondsep), _height); + _height = _contentsItem.setGeometry(width - secondColHandleRect.right()); + _timestampItem.setGeometry(firstColHandleRect.left(), _height); + _senderItem.setGeometry(secondColHandleRect.left() - firstColHandleRect.right(), _height); - _senderItem.setPos(firstHandlePos + firstsep, 0); - _contentsItem.setPos(secondHandlePos + secondsep, 0); + _senderItem.setPos(firstColHandleRect.right(), 0); + _contentsItem.setPos(secondColHandleRect.right(), 0); _width = width; return _height; @@ -111,6 +111,8 @@ void ChatLine::setHighlighted(bool highlighted) { } void ChatLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option); + Q_UNUSED(widget); if(_selection & Highlighted) { painter->fillRect(boundingRect(), QBrush(QtUi::style()->highlightColor())); }