subsurface/stats/statsseries.cpp
Berthold Stoeger b5aac29cea statistics: collect colors in a StatsTheme class
To enable rudimentary theming, collect all colors in a new
theme class. The class has to be passed down to the various
items.

In general the items save a reference to the them in the
constructor. Alternatively, they might also just query
the StatsView everytime they need to access a color.
For now, it's hard the say what is preferred: a reference
per item or a function call per invokation?

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-03-16 15:26:54 -07:00

28 lines
627 B
C++

// SPDX-License-Identifier: GPL-2.0
#include "statsseries.h"
#include "statsaxis.h"
#include "statsview.h"
StatsSeries::StatsSeries(StatsView &view, StatsAxis *xAxis, StatsAxis *yAxis) :
view(view), theme(view.getCurrentTheme()), xAxis(xAxis), yAxis(yAxis)
{
}
StatsSeries::~StatsSeries()
{
}
QPointF StatsSeries::toScreen(QPointF p)
{
return xAxis && yAxis ? QPointF(xAxis->toScreen(p.x()), yAxis->toScreen(p.y()))
: QPointF(0.0, 0.0);
}
bool StatsSeries::supportsLassoSelection() const
{
return false;
}
void StatsSeries::selectItemsInRect(const QRectF &, SelectionModifier, const std::vector<dive *> &)
{
}