mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Anchor bottom of the dive ruler editor ro items on the DivePlanner
This patch is a crude attempt to 'anchor' the bottom of the Dive ruler editor ( the new graphics ) to the bottom of the scene. since QGraphicsView doesn't have a good way to modify the origin point of an item, I'v just shifted all other items up a bit, this way the 0,0 point is in the bottom of the drawing and I can safely move it around, making it bottom-anchorable. :D Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0c3eef1c4c
commit
4433830f55
1 changed files with 9 additions and 3 deletions
|
@ -140,7 +140,7 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget* parent): QGraphicsView(parent)
|
|||
timeHandler->icon->setPixmap(QString(":icon_time"));
|
||||
connect(timeHandler->increaseBtn, SIGNAL(clicked()), this, SLOT(increaseTime()));
|
||||
connect(timeHandler->decreaseBtn, SIGNAL(clicked()), this, SLOT(decreaseTime()));
|
||||
timeHandler->setPos(fromPercent(83, Qt::Horizontal), fromPercent(85, Qt::Vertical));
|
||||
timeHandler->setPos(fromPercent(83, Qt::Horizontal), fromPercent(100, Qt::Vertical));
|
||||
timeHandler->setZValue(-2);
|
||||
scene()->addItem(timeHandler);
|
||||
|
||||
|
@ -150,7 +150,7 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget* parent): QGraphicsView(parent)
|
|||
depthHandler->icon->setPixmap(QString(":icon_depth"));
|
||||
connect(depthHandler->increaseBtn, SIGNAL(clicked()), this, SLOT(increaseDepth()));
|
||||
connect(depthHandler->decreaseBtn, SIGNAL(clicked()), this, SLOT(decreaseDepth()));
|
||||
depthHandler->setPos(fromPercent(0, Qt::Horizontal), fromPercent(85, Qt::Vertical));
|
||||
depthHandler->setPos(fromPercent(0, Qt::Horizontal), fromPercent(100, Qt::Vertical));
|
||||
depthHandler->setZValue(-2);
|
||||
scene()->addItem(depthHandler);
|
||||
|
||||
|
@ -1489,5 +1489,11 @@ ExpanderGraphics::ExpanderGraphics(QGraphicsItem* parent): QGraphicsRectItem(par
|
|||
decreaseBtn->setPos(leftWing->pos().x(), leftWing->pos().y() );
|
||||
increaseBtn->setPos(rightWing->pos().x(), rightWing->pos().y() );
|
||||
icon->setPos(bg->pos().x(), bg->pos().y() - 5);
|
||||
setTransformOriginPoint(transformOriginPoint().x(), transformOriginPoint().y() - childrenBoundingRect().height());
|
||||
|
||||
//I need to bottom align the items, I need to make the 0,0 ( orgin ) to be
|
||||
// the bottom of this item, so shift everything up.
|
||||
QRectF r = childrenBoundingRect();
|
||||
Q_FOREACH(QGraphicsItem *i, childItems()){
|
||||
i->setPos(i->pos().x(), i->pos().y() - r.height());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue