diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-07-11 19:13:01 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-11 17:01:12 -0700 |
commit | e18f4dfdeecfb8fdc3cf7bcb7168d84613d4fc7b (patch) | |
tree | c498c5401d2601b3128499b30136997796b2f487 /qt-ui | |
parent | 2171b981ac5a827e732cadefabf8a09762a8c45c (diff) | |
download | subsurface-e18f4dfdeecfb8fdc3cf7bcb7168d84613d4fc7b.tar.gz |
Code cleanup: removed bogus animation functions
All animations are now on the Animations namespace, which resulted in a
bit of code cleanup, which is nice.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profile/divecartesianaxis.cpp | 16 | ||||
-rw-r--r-- | qt-ui/profile/divelineitem.cpp | 10 | ||||
-rw-r--r-- | qt-ui/profile/divelineitem.h | 2 | ||||
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 3 | ||||
-rw-r--r-- | qt-ui/profile/divetextitem.cpp | 10 | ||||
-rw-r--r-- | qt-ui/profile/divetextitem.h | 2 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 2 |
7 files changed, 11 insertions, 34 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 4053ee1cd..f5123ae9e 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -173,9 +173,9 @@ void DiveCartesianAxis::updateTicks(color_indice_t color) labels[i]->setText(textForValue(currValueText)); if (orientation == LeftToRight || orientation == RightToLeft) { - labels[i]->animateMoveTo(childPos, m.y1() + tick_size); + Animations::moveTo(labels[i],childPos, m.y1() + tick_size); } else { - labels[i]->animateMoveTo(m.x1() - tick_size, childPos); + Animations::moveTo(labels[i],m.x1() - tick_size, childPos); } } @@ -185,9 +185,9 @@ void DiveCartesianAxis::updateTicks(color_indice_t color) begin - i * stepSize; if (orientation == LeftToRight || orientation == RightToLeft) { - lines[i]->animateMoveTo(childPos, m.y1()); + Animations::moveTo(lines[i],childPos, m.y1()); } else { - lines[i]->animateMoveTo(m.x1(), childPos); + Animations::moveTo(lines[i],m.x1(), childPos); } } @@ -208,11 +208,11 @@ void DiveCartesianAxis::updateTicks(color_indice_t color) if (orientation == RightToLeft || orientation == LeftToRight) { label->setAlignment(Qt::AlignBottom | Qt::AlignHCenter); label->setPos(scene()->sceneRect().width() + 10, m.y1() + tick_size); // position it outside of the scene); - label->animateMoveTo(childPos, m.y1() + tick_size); + Animations::moveTo(label,childPos, m.y1() + tick_size); } else { label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); label->setPos(m.x1() - tick_size, scene()->sceneRect().height() + 10); - label->animateMoveTo(m.x1() - tick_size, childPos); + Animations::moveTo(label,m.x1() - tick_size, childPos); } } @@ -235,13 +235,13 @@ void DiveCartesianAxis::updateTicks(color_indice_t color) if (orientation == RightToLeft || orientation == LeftToRight) { line->setLine(0, -line_size, 0, 0); line->setPos(scene()->sceneRect().width() + 10, m.y1()); // position it outside of the scene); - line->animateMoveTo(childPos, m.y1()); + Animations::moveTo(line,childPos, m.y1()); } else { QPointF p1 = mapFromScene(3, 0); QPointF p2 = mapFromScene(line_size, 0); line->setLine(p1.x(), 0, p2.x(), 0); line->setPos(m.x1(), scene()->sceneRect().height() + 10); - line->animateMoveTo(m.x1(), childPos); + Animations::moveTo(line,m.x1(), childPos); } } diff --git a/qt-ui/profile/divelineitem.cpp b/qt-ui/profile/divelineitem.cpp index eb3d1db9c..863cd6218 100644 --- a/qt-ui/profile/divelineitem.cpp +++ b/qt-ui/profile/divelineitem.cpp @@ -5,13 +5,3 @@ DiveLineItem::DiveLineItem(QGraphicsItem *parent) : QGraphicsLineItem(parent) { } - -void DiveLineItem::animatedHide() -{ - Animations::hide(this); -} - -void DiveLineItem::animateMoveTo(qreal x, qreal y) -{ - Animations::moveTo(this, x, y); -} diff --git a/qt-ui/profile/divelineitem.h b/qt-ui/profile/divelineitem.h index 3643d6e60..ec88e9da5 100644 --- a/qt-ui/profile/divelineitem.h +++ b/qt-ui/profile/divelineitem.h @@ -10,8 +10,6 @@ class DiveLineItem : public QObject, public QGraphicsLineItem { Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) public: DiveLineItem(QGraphicsItem *parent = 0); - void animatedHide(); - void animateMoveTo(qreal x, qreal y); }; #endif // DIVELINEITEM_H diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index cc4989d33..1c8a13fb5 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -4,6 +4,7 @@ #include "graphicsview-common.h" #include "divetextitem.h" #include "profilewidget2.h" +#include "animationfunctions.h" #include "profile.h" #include "dive.h" #include "preferences.h" @@ -666,7 +667,7 @@ void MeanDepthLine::setAxis(DiveCartesianAxis *a) void MeanDepthLine::axisLineChanged() { DiveCartesianAxis *axis = qobject_cast<DiveCartesianAxis *>(sender()); - animateMoveTo(x(), axis->posAtValue(meanDepth)); + Animations::moveTo(this, x(), axis->posAtValue(meanDepth)); } void PartialPressureGasItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) diff --git a/qt-ui/profile/divetextitem.cpp b/qt-ui/profile/divetextitem.cpp index c2ba2efc4..fad35eb2f 100644 --- a/qt-ui/profile/divetextitem.cpp +++ b/qt-ui/profile/divetextitem.cpp @@ -94,13 +94,3 @@ void DiveTextItem::updateText() textItem->setBrush(brush); textItem->setPen(Qt::NoPen); } - -void DiveTextItem::animatedHide() -{ - Animations::hide(this); -} - -void DiveTextItem::animateMoveTo(qreal x, qreal y) -{ - Animations::moveTo(this, x, y); -} diff --git a/qt-ui/profile/divetextitem.h b/qt-ui/profile/divetextitem.h index 19bf00a73..a6c0622f8 100644 --- a/qt-ui/profile/divetextitem.h +++ b/qt-ui/profile/divetextitem.h @@ -17,8 +17,6 @@ public: void setAlignment(int alignFlags); void setScale(double newscale); void setBrush(const QBrush &brush); - void animatedHide(); - void animateMoveTo(qreal x, qreal y); const QString &text(); private: diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 59e6cb17b..69c52b787 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -490,7 +490,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) meanDepth->setVisible(false); meanDepth->setMeanDepth(pInfo.meandepth); meanDepth->setLine(0, 0, timeAxis->posAtValue(displayed_dive.duration.seconds), 0); - meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth)); + Animations::moveTo(meanDepth,3, profileYAxis->posAtValue(pInfo.meandepth)); dataModel->emitDataChanged(); // The event items are a bit special since we don't know how many events are going to |