From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/study/CardsStatusBar.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/study/CardsStatusBar.h (limited to 'src/study/CardsStatusBar.h') diff --git a/src/study/CardsStatusBar.h b/src/study/CardsStatusBar.h new file mode 100644 index 0000000..10344f7 --- /dev/null +++ b/src/study/CardsStatusBar.h @@ -0,0 +1,37 @@ +#ifndef CARDSSTATUSBAR_H +#define CARDSSTATUSBAR_H + +#include + +class CardsStatusBar : public QWidget +{ + Q_OBJECT +public: + static const QStringList Colors; + +public: + CardsStatusBar(QWidget* aParent = 0); + ~CardsStatusBar(); + void setValues(const QList& values) { this->values = values; update(); } + +protected: + virtual void paintEvent(QPaintEvent* aEvent); + +private: + int getMax() const; + void drawSection(int index); + QLinearGradient getSectionGradient(int index); + QRectF getSectionRect(int index); + +private: + static const int Radius = 6; + +private: + QList values; + qreal max; + QRectF barRect; + QPainter* painter; + qreal sectionLeft; +}; + +#endif -- cgit