2017-04-27 20:26:36 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-02-27 13:28:58 -03:00
|
|
|
#ifndef RULERITEM_H
|
|
|
|
#define RULERITEM_H
|
|
|
|
|
2024-01-12 22:26:32 +01:00
|
|
|
#include "qt-quick/chartitem.h"
|
2014-02-27 13:28:58 -03:00
|
|
|
|
2024-01-12 22:26:32 +01:00
|
|
|
#include <QFont>
|
|
|
|
#include <QFontMetrics>
|
2014-02-27 20:09:57 -08:00
|
|
|
|
2024-01-12 22:26:32 +01:00
|
|
|
class ProfileView;
|
|
|
|
class ProfileScene;
|
|
|
|
class RulerItemHandle;
|
|
|
|
struct plot_info;
|
|
|
|
struct dive;
|
2014-02-27 13:28:58 -03:00
|
|
|
|
2024-01-12 22:26:32 +01:00
|
|
|
class RulerItem {
|
|
|
|
ChartItemPtr<ChartLineItem> line;
|
|
|
|
ChartItemPtr<RulerItemHandle> handle1, handle2;
|
|
|
|
ChartItemPtr<AnimatedChartRectItem> tooltip;
|
2014-02-27 13:28:58 -03:00
|
|
|
|
2024-01-12 22:26:32 +01:00
|
|
|
QFont font;
|
|
|
|
QFontMetrics fm;
|
|
|
|
double fontHeight;
|
|
|
|
QPixmap title;
|
2014-02-27 13:28:58 -03:00
|
|
|
public:
|
2024-01-12 22:26:32 +01:00
|
|
|
RulerItem(ProfileView &view, double dpr);
|
2024-01-20 21:03:02 +01:00
|
|
|
~RulerItem();
|
2014-05-21 12:18:05 -03:00
|
|
|
void setVisible(bool visible);
|
2024-01-12 22:26:32 +01:00
|
|
|
void update(const dive *d, double dpr, const ProfileScene &scene, const plot_info &info, int animspeed);
|
|
|
|
void anim(double progress);
|
2014-02-27 13:28:58 -03:00
|
|
|
};
|
2024-01-12 22:26:32 +01:00
|
|
|
|
2014-03-12 00:09:53 +02:00
|
|
|
#endif
|