X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmarkerlineitem.cpp;h=52cc48861d670ec8e56a4559cabb2a5cf788fea2;hp=4ec1651f204523554cd21d1a2fd384a172419989;hb=edc55b1f86cf613a332eeeb5d85537a54120dfa5;hpb=fcacaaf16551524c7ebb6114254d005274cc3d63 diff --git a/src/qtui/markerlineitem.cpp b/src/qtui/markerlineitem.cpp index 4ec1651f..52cc4886 100644 --- a/src/qtui/markerlineitem.cpp +++ b/src/qtui/markerlineitem.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,31 +18,30 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ +#include "markerlineitem.h" + #include -#include "markerlineitem.h" #include "qtui.h" -MarkerLineItem::MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent) - : QGraphicsObject(parent), - _boundingRect(0, 0, sceneWidth, 1), - _chatLine(nullptr) +MarkerLineItem::MarkerLineItem(qreal sceneWidth, QGraphicsItem* parent) + : QGraphicsObject(parent) + , _boundingRect(0, 0, sceneWidth, 1) + , _chatLine(nullptr) { setVisible(false); setZValue(8); - styleChanged(); // init brush and height + styleChanged(); // init brush and height connect(QtUi::style(), &UiStyle::changed, this, &MarkerLineItem::styleChanged); } - -void MarkerLineItem::setChatLine(ChatLine *line) +void MarkerLineItem::setChatLine(ChatLine* line) { _chatLine = line; if (!line) setVisible(false); } - void MarkerLineItem::styleChanged() { _brush = QtUi::style()->brush(UiStyle::ColorRole::MarkerLine); @@ -57,15 +56,13 @@ void MarkerLineItem::styleChanged() _boundingRect = QRectF(0, 0, scene() ? scene()->width() : 100, height); } - -void MarkerLineItem::sceneRectChanged(const QRectF &rect) +void MarkerLineItem::sceneRectChanged(const QRectF& rect) { prepareGeometryChange(); _boundingRect.setWidth(rect.width()); } - -void MarkerLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void MarkerLineItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { Q_UNUSED(option); Q_UNUSED(widget);