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>
This commit is contained in:
Berthold Stoeger 2021-01-31 20:48:12 +01:00 committed by Dirk Hohndel
parent 5c098eea29
commit d85b321784
9 changed files with 68 additions and 8 deletions

View file

@ -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