summaryrefslogtreecommitdiff
path: root/src/study/CardsStatusBar.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/study/CardsStatusBar.h')
-rw-r--r--src/study/CardsStatusBar.h37
1 files changed, 37 insertions, 0 deletions
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 <QtWidgets>
+
+class CardsStatusBar : public QWidget
+{
+ Q_OBJECT
+public:
+ static const QStringList Colors;
+
+public:
+ CardsStatusBar(QWidget* aParent = 0);
+ ~CardsStatusBar();
+ void setValues(const QList<int>& 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<int> values;
+ qreal max;
+ QRectF barRect;
+ QPainter* painter;
+ qreal sectionLeft;
+};
+
+#endif