Reformat ALL the source!
[quassel.git] / src / qtui / markerlineitem.cpp
index 563ef4e..2a46bbc 100644 (file)
 #include "qtui.h"
 
 MarkerLineItem::MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent)
-  : QGraphicsObject(parent),
+    : QGraphicsObject(parent),
     _boundingRect(0, 0, sceneWidth, 1),
     _chatLine(0)
 {
-  setVisible(false);
-  setZValue(8);
-  styleChanged(); // init brush and height
-  connect(QtUi::style(), SIGNAL(changed()), SLOT(styleChanged()));
+    setVisible(false);
+    setZValue(8);
+    styleChanged(); // init brush and height
+    connect(QtUi::style(), SIGNAL(changed()), SLOT(styleChanged()));
 }
 
-void MarkerLineItem::setChatLine(ChatLine *line) {
-  _chatLine = line;
-  if(!line)
-    setVisible(false);
+
+void MarkerLineItem::setChatLine(ChatLine *line)
+{
+    _chatLine = line;
+    if (!line)
+        setVisible(false);
 }
 
-void MarkerLineItem::styleChanged() {
-  _brush = QtUi::style()->brush(UiStyle::MarkerLine);
 
-  // if this is a solid color, we assume 1px because wesurely  don't surely don't want to fill the entire chatline.
-  // else, use the height of a single line of text to play around with gradients etc.
-  qreal height = 1.;
-  if(_brush.style() != Qt::SolidPattern)
-    height = QtUi::style()->fontMetrics(QtUiStyle::PlainMsg, 0)->lineSpacing();
+void MarkerLineItem::styleChanged()
+{
+    _brush = QtUi::style()->brush(UiStyle::MarkerLine);
 
+    // if this is a solid color, we assume 1px because wesurely  don't surely don't want to fill the entire chatline.
+    // else, use the height of a single line of text to play around with gradients etc.
+    qreal height = 1.;
+    if (_brush.style() != Qt::SolidPattern)
+        height = QtUi::style()->fontMetrics(QtUiStyle::PlainMsg, 0)->lineSpacing();
 
-  prepareGeometryChange();
-  _boundingRect = QRectF(0, 0, scene()? scene()->width() : 100, height);
+    prepareGeometryChange();
+    _boundingRect = QRectF(0, 0, scene() ? scene()->width() : 100, height);
 }
 
-void MarkerLineItem::sceneRectChanged(const QRectF &rect) {
-  prepareGeometryChange();
-  _boundingRect.setWidth(rect.width());
+
+void MarkerLineItem::sceneRectChanged(const QRectF &rect)
+{
+    prepareGeometryChange();
+    _boundingRect.setWidth(rect.width());
 }
 
-void MarkerLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
 
-  painter->fillRect(boundingRect(), _brush);
+void MarkerLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+{
+    Q_UNUSED(option);
+    Q_UNUSED(widget);
+
+    painter->fillRect(boundingRect(), _brush);
 }