Depth widget minor UX improvement

Decrease depth by tapping left part of widget. Icon is showing "up" (i.e. closer to surface).
Increase depth by tapping right part of widget. Icon is showing "down" (i.e. deeper).

Fixes #354

Signed-off-by: Andrey Zhdanov <andrjufka@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Andrey Zhdanov 2014-03-03 23:09:29 +02:00 committed by Dirk Hohndel
parent 7c535452f9
commit 64b7a3b85f

View file

@ -134,13 +134,11 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent
timeHandler->setZValue(-2); timeHandler->setZValue(-2);
scene()->addItem(timeHandler); scene()->addItem(timeHandler);
depthHandler->increaseBtn->setPixmap(QString(":arrow_up")); depthHandler->increaseBtn->setPixmap(QString(":arrow_down"));
depthHandler->decreaseBtn->setPixmap(QString(":arrow_down")); depthHandler->decreaseBtn->setPixmap(QString(":arrow_up"));
depthHandler->icon->setPixmap(QString(":icon_depth")); depthHandler->icon->setPixmap(QString(":icon_depth"));
// Inverted here in the slots because the 'up' graphi should increase the depness, connect(depthHandler->decreaseBtn, SIGNAL(clicked()), this, SLOT(decreaseDepth()));
// and the down should decrease. connect(depthHandler->increaseBtn, SIGNAL(clicked()), this, SLOT(increaseDepth()));
connect(depthHandler->increaseBtn, SIGNAL(clicked()), this, SLOT(decreaseDepth()));
connect(depthHandler->decreaseBtn, SIGNAL(clicked()), this, SLOT(increaseDepth()));
depthHandler->setPos(fromPercent(0, Qt::Horizontal), fromPercent(100, Qt::Vertical)); depthHandler->setPos(fromPercent(0, Qt::Horizontal), fromPercent(100, Qt::Vertical));
depthHandler->setZValue(-2); depthHandler->setZValue(-2);
scene()->addItem(depthHandler); scene()->addItem(depthHandler);