diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-07-10 22:23:25 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2019-07-12 09:59:28 +0200 |
commit | 2d9dc40171c261fc6c907badb871d6735d59787a (patch) | |
tree | 2487adcae3442bd716a2aa0d0e3dbcd7f9e7e513 /profile-widget/divecartesianaxis.cpp | |
parent | 74244b3cfebb08d60fd32e938b396e8fa90a4774 (diff) | |
download | subsurface-2d9dc40171c261fc6c907badb871d6735d59787a.tar.gz |
Profile: add speed parameter to Animation::* functions
For now always use the preferences value, so that this is a
no-op. This is a preparation for storing the speed in the
profile widget.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/divecartesianaxis.cpp')
-rw-r--r-- | profile-widget/divecartesianaxis.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/profile-widget/divecartesianaxis.cpp b/profile-widget/divecartesianaxis.cpp index e37c311d3..c4beb4036 100644 --- a/profile-widget/divecartesianaxis.cpp +++ b/profile-widget/divecartesianaxis.cpp @@ -10,6 +10,7 @@ #include "profile-widget/animationfunctions.h" #include "profile-widget/divelineitem.h" #include "profile-widget/profilewidget2.h" +#include "core/settings/qPrefDisplay.h" // TODO: Remove QPen DiveCartesianAxis::gridPen() { @@ -130,7 +131,7 @@ void emptyList(QList<T *> &list, int steps) { while (list.size() > steps) { T *removedItem = list.takeLast(); - Animations::animDelete(removedItem); + Animations::animDelete(removedItem, qPrefDisplay::animation_speed()); } } @@ -177,9 +178,9 @@ void DiveCartesianAxis::updateTicks(color_index_t color) labels[i]->setText(textForValue(currValueText)); if (orientation == LeftToRight || orientation == RightToLeft) { - Animations::moveTo(labels[i],childPos, m.y1() + tick_size); + Animations::moveTo(labels[i], qPrefDisplay::animation_speed(), childPos, m.y1() + tick_size); } else { - Animations::moveTo(labels[i],m.x1() - tick_size, childPos); + Animations::moveTo(labels[i], qPrefDisplay::animation_speed() ,m.x1() - tick_size, childPos); } } @@ -189,9 +190,9 @@ void DiveCartesianAxis::updateTicks(color_index_t color) begin - i * stepSize; if (orientation == LeftToRight || orientation == RightToLeft) { - Animations::moveTo(lines[i],childPos, m.y1()); + Animations::moveTo(lines[i], qPrefDisplay::animation_speed(), childPos, m.y1()); } else { - Animations::moveTo(lines[i],m.x1(), childPos); + Animations::moveTo(lines[i], qPrefDisplay::animation_speed(), m.x1(), childPos); } } @@ -212,11 +213,11 @@ void DiveCartesianAxis::updateTicks(color_index_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); - Animations::moveTo(label,childPos, m.y1() + tick_size); + Animations::moveTo(label, qPrefDisplay::animation_speed(),childPos , m.y1() + tick_size); } else { label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); label->setPos(m.x1() - tick_size, scene()->sceneRect().height() + 10); - Animations::moveTo(label,m.x1() - tick_size, childPos); + Animations::moveTo(label, qPrefDisplay::animation_speed(), m.x1() - tick_size, childPos); } } @@ -237,13 +238,13 @@ void DiveCartesianAxis::updateTicks(color_index_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); - Animations::moveTo(line,childPos, m.y1()); + Animations::moveTo(line, qPrefDisplay::animation_speed(), 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); - Animations::moveTo(line,m.x1(), childPos); + Animations::moveTo(line, qPrefDisplay::animation_speed(), m.x1(), childPos); } } |