mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +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>
28 lines
696 B
C++
28 lines
696 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
// A small box displaying statistics information, notably
|
|
// for a scatter-plot item or a bar in a bar chart.
|
|
#ifndef INFORMATION_BOX_H
|
|
#define INFORMATION_BOX_H
|
|
|
|
#include "chartitem.h"
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
#include <QFont>
|
|
|
|
struct dive;
|
|
class StatsView;
|
|
|
|
// Information window showing data of highlighted dive
|
|
struct InformationBox : ChartRectItem {
|
|
InformationBox(StatsView &);
|
|
void setText(const std::vector<QString> &text, QPointF pos);
|
|
void setPos(QPointF pos);
|
|
int recommendedMaxLines() const;
|
|
private:
|
|
const StatsTheme &theme; // Set once in constructor.
|
|
QFont font; // For future specialization.
|
|
double width, height;
|
|
};
|
|
|
|
#endif
|