summaryrefslogtreecommitdiffstats
path: root/stats/chartitem.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-31 20:48:12 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-13 13:02:54 -0800
commitd85b3217840656bf371cd64264ee472a68c3141a (patch)
tree8f5a9ffb3e956c1b262b3a36e88e0b0895b09878 /stats/chartitem.h
parent5c098eea29fdb1cd663b78db4e430a1c76c2209a (diff)
downloadsubsurface-d85b3217840656bf371cd64264ee472a68c3141a.tar.gz
statistics: show selected dives in scatter plot
As a visual feedback, show the selected dives in the scatter plot. React to application-wide selection changes. Currently, the dive list is deactivated while in statistics mode, but that may change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/chartitem.h')
-rw-r--r--stats/chartitem.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/stats/chartitem.h b/stats/chartitem.h
index cf20f55a8..c700cb421 100644
--- a/stats/chartitem.h
+++ b/stats/chartitem.h
@@ -174,16 +174,23 @@ public:
ChartScatterItem(StatsView &v, ChartZValue z);
~ChartScatterItem();
+ // Currently, there is no highlighted and selected status.
+ enum class Highlight {
+ Unselected,
+ Selected,
+ Highlighted
+ };
void setPos(QPointF pos); // Specifies the *center* of the item.
- void setHighlight(bool highlight); // In the future, support different kinds of scatter items.
+ void setHighlight(Highlight highlight); // In the future, support different kinds of scatter items.
void render() override; // Only call on render thread!
QRectF getRect() const;
bool contains(QPointF point) const;
private:
+ QSGTexture *getTexture() const;
QRectF rect;
QSizeF textureSize;
bool positionDirty, textureDirty;
- bool highlighted;
+ Highlight highlight;
};
// Implementation detail of templates - move to serparate header file