mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 21:20:19 +00:00
980737221d
Previously all text in the new profile was deawn in the same font. With this change the labels on all axes are smaller. It might be even better to allow per-axis configuration of the label size as along the time axis the bigger size looked better. But especially for partial pressures this looks much better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
34 lines
884 B
C++
34 lines
884 B
C++
#ifndef DIVETEXTITEM_H
|
|
#define DIVETEXTITEM_H
|
|
|
|
#include <QObject>
|
|
#include <QGraphicsItemGroup>
|
|
#include "graphicsview-common.h"
|
|
#include <QBrush>
|
|
|
|
/* A Line Item that has animated-properties. */
|
|
class DiveTextItem :public QObject, public QGraphicsItemGroup{
|
|
Q_OBJECT
|
|
Q_PROPERTY(QPointF pos READ pos WRITE setPos)
|
|
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
|
|
public:
|
|
DiveTextItem(QGraphicsItem* parent = 0);
|
|
void setText(const QString& text);
|
|
void setAlignment(int alignFlags);
|
|
void setScale(double newscale);
|
|
void setBrush(const QBrush& brush);
|
|
void animatedHide();
|
|
void animateMoveTo(qreal x, qreal y);
|
|
const QString& text();
|
|
private:
|
|
void updateText();
|
|
int internalAlignFlags;
|
|
QGraphicsPathItem *textBackgroundItem;
|
|
QGraphicsPathItem *textItem;
|
|
QString internalText;
|
|
color_indice_t colorIndex;
|
|
QBrush brush;
|
|
double scale;
|
|
};
|
|
|
|
#endif // DIVETEXTITEM_H
|