summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-16 16:06:14 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-17 08:04:08 +1300
commit48a23b9b3ceb7cd6b9de0e2faad8845e6cdaf692 (patch)
tree3931e4d35a7383427b9b43e25cc7346000e3f20f /qt-ui/profile
parentdeafa40d34f2a4c86a51aed6eb57c542356387db (diff)
downloadsubsurface-48a23b9b3ceb7cd6b9de0e2faad8845e6cdaf692.tar.gz
Remove the background and the separator
Those items were used to fake the background of the path item but since the rectangle can be painted with a border and a fill, this is uneeded. The rect is still ugly. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/divetooltipitem.cpp25
-rw-r--r--qt-ui/profile/divetooltipitem.h2
2 files changed, 2 insertions, 25 deletions
diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp
index c351a30f0..a8685673c 100644
--- a/qt-ui/profile/divetooltipitem.cpp
+++ b/qt-ui/profile/divetooltipitem.cpp
@@ -62,10 +62,6 @@ void ToolTipItem::setRect(const QRectF &r)
}
QGraphicsRectItem::setRect(r);
- QPainterPath bg;
- bg.addRoundedRect(-1, -1, rect().width() + 3, rect().height() + 4, 3, 3);
-
- background->setPath(bg);
updateTitlePosition();
}
@@ -127,8 +123,6 @@ void ToolTipItem::expand()
}
ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsRectItem(parent),
- background(0),
- separator(new QGraphicsLineItem(this)),
title(new QGraphicsSimpleTextItem(tr("Information"), this)),
status(COLLAPSED),
timeAxis(0),
@@ -141,23 +135,15 @@ ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsRectItem(parent),
QColor c = QColor(Qt::black);
c.setAlpha(155);
- background = new QGraphicsPathItem(this);
- background->setFlag(ItemStacksBehindParent);
- background->setFlag(ItemIgnoresTransformations);
- background->setBrush(c);
- background->setPen(QPen(QBrush(Qt::transparent), 0));
- background->setZValue(-10);
+ setBrush(c);
+ setPen(QPen(QBrush(Qt::transparent), 0));
- updateTitlePosition();
setZValue(99);
addToolTip(QString(), QIcon(), QPixmap(16,60));
entryToolTip = toolTips.first();
toolTips.clear();
- separator->setFlag(ItemIgnoresTransformations);
- separator->setPen(QPen(Qt::white));
-
title->setFlag(ItemIgnoresTransformations);
title->setPen(QPen(Qt::white, 1));
title->setBrush(Qt::white);
@@ -182,13 +168,6 @@ void ToolTipItem::updateTitlePosition()
}
title->setPos(boundingRect().width() / 2 - title->boundingRect().width() / 2 - 1, 0);
-
- double x1 = 3;
- double y1 = title->pos().y() + iconMetrics.spacing / 2 + title->boundingRect().height();
- double x2 = boundingRect().width() - 10;
- double y2 = y1;
-
- separator->setLine(x1, y1, x2, y2);
}
bool ToolTipItem::isExpanded() const
diff --git a/qt-ui/profile/divetooltipitem.h b/qt-ui/profile/divetooltipitem.h
index 7ac9d8652..a383fecb3 100644
--- a/qt-ui/profile/divetooltipitem.h
+++ b/qt-ui/profile/divetooltipitem.h
@@ -51,8 +51,6 @@ private:
typedef QPair<QGraphicsPixmapItem *, QGraphicsSimpleTextItem *> ToolTip;
QVector<ToolTip> toolTips;
ToolTip entryToolTip;
- QGraphicsPathItem *background;
- QGraphicsLineItem *separator;
QGraphicsSimpleTextItem *title;
Status status;
QRectF rectangle;