mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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:
parent
2c4e4b1e86
commit
b0faf2e4b1
4 changed files with 6 additions and 18 deletions
|
@ -311,7 +311,6 @@ void DiveCartesianAxis::animateChangeLine(const QRectF &rectIn, int animSpeed)
|
|||
break;
|
||||
}
|
||||
updateTicks(animSpeed);
|
||||
sizeChanged();
|
||||
}
|
||||
|
||||
double DiveCartesianAxis::Transform::to(double x) const
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue