mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
This needed a bit of refactoring of the ChartItem code, because we have to be signaled on drag start. Currently only one handle can be selected at a time. This was (implicitly) the case anyway, as far as I can tell. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
33 lines
706 B
C++
33 lines
706 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef RULERITEM_H
|
|
#define RULERITEM_H
|
|
|
|
#include "qt-quick/chartitem.h"
|
|
|
|
#include <QFont>
|
|
#include <QFontMetrics>
|
|
|
|
class ProfileView;
|
|
class ProfileScene;
|
|
class RulerItemHandle;
|
|
struct plot_info;
|
|
struct dive;
|
|
|
|
class RulerItem {
|
|
ChartItemPtr<ChartLineItem> line;
|
|
ChartItemPtr<RulerItemHandle> handle1, handle2;
|
|
ChartItemPtr<AnimatedChartRectItem> tooltip;
|
|
|
|
QFont font;
|
|
QFontMetrics fm;
|
|
double fontHeight;
|
|
QPixmap title;
|
|
public:
|
|
RulerItem(ProfileView &view, double dpr);
|
|
~RulerItem();
|
|
void setVisible(bool visible);
|
|
void update(const dive *d, double dpr, const ProfileScene &scene, const plot_info &info, int animspeed);
|
|
void anim(double progress);
|
|
};
|
|
|
|
#endif
|