mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
b5aac29cea
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>
23 lines
511 B
C++
23 lines
511 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
// The background grid of a chart
|
|
|
|
#include "statshelper.h"
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
class StatsAxis;
|
|
class StatsTheme;
|
|
class StatsView;
|
|
class ChartLineItem;
|
|
|
|
class StatsGrid {
|
|
public:
|
|
StatsGrid(StatsView &view, const StatsAxis &xAxis, const StatsAxis &yAxis);
|
|
void updatePositions();
|
|
private:
|
|
StatsView &view;
|
|
const StatsTheme &theme; // Initialized once in constructor.
|
|
const StatsAxis &xAxis, &yAxis;
|
|
std::vector<ChartItemPtr<ChartLineItem>> lines;
|
|
};
|