profile: remove DiveCartesianAxis::sizeChanged() signal

This was used to animate the position of the dive event items
when the size of the axis changed. However, that doesn't work
since quite some time. The axes size are changed when
 1) switching dives
 2) resizing the drawing area
In the first case, the dive event items are fully recalculated.
In the second case, animation speed is set to instant, since
resizing of windows is done continuously on any reasonably
modern desktop anyway. It might make sense on mobile, where
size changes are discontinuous, but there we use static
profiles anyway. Moreover, I checked a few applications and
none of them had animations when switching orientation of
my tablet.

Let's just remove this disfunctional thing and replace it
later, should someone complain.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-09-27 09:37:15 +02:00 committed by Dirk Hohndel
parent 2c4e4b1e86
commit b0faf2e4b1
4 changed files with 6 additions and 18 deletions

View file

@ -311,7 +311,6 @@ void DiveCartesianAxis::animateChangeLine(const QRectF &rectIn, int animSpeed)
break;
}
updateTicks(animSpeed);
sizeChanged();
}
double DiveCartesianAxis::Transform::to(double x) const

View file

@ -52,9 +52,6 @@ public:
double width() const; // only for vertical axes
double height() const; // only for horizontal axes
signals:
void sizeChanged();
protected:
Position position;
int fractionalDigits;

View file

@ -27,10 +27,7 @@ DiveEventItem::DiveEventItem(const struct dive *d, struct event *ev, struct gasm
setupPixmap(lastgasmix, pixmaps);
setupToolTipString(lastgasmix);
recalculatePos(0);
connect(vAxis, &DiveCartesianAxis::sizeChanged, this,
[speed, this] { recalculatePos(speed); });
recalculatePos();
}
DiveEventItem::~DiveEventItem()
@ -228,7 +225,7 @@ bool DiveEventItem::shouldBeHidden()
return false;
}
void DiveEventItem::recalculatePos(int speed)
void DiveEventItem::recalculatePos()
{
if (!ev)
return;
@ -238,10 +235,7 @@ void DiveEventItem::recalculatePos(int speed)
return;
}
setVisible(!shouldBeHidden());
qreal x = hAxis->posAtValue(ev->time.seconds);
qreal y = vAxis->posAtValue(depth);
if (speed > 0)
Animations::moveTo(this, speed, x, y);
else
setPos(x, y);
double x = hAxis->posAtValue(ev->time.seconds);
double y = vAxis->posAtValue(depth);
setPos(x, y);
}

View file

@ -24,13 +24,11 @@ public:
bool shouldBeHidden();
static bool isInteresting(const struct dive *d, const struct divecomputer *dc,
const struct event *ev, const struct plot_info &pi);
public
slots:
void recalculatePos(int animationSpeed);
private:
void setupToolTipString(struct gasmix lastgasmix);
void setupPixmap(struct gasmix lastgasmix, const DivePixmaps &pixmaps);
void recalculatePos();
DiveCartesianAxis *vAxis;
DiveCartesianAxis *hAxis;
struct event *ev;