File indexing completed on 2024-03-24 03:53:48
0001 /* 0002 SPDX-FileCopyrightText: 2014 Andreas Xavier 0003 SPDX-FileCopyrightText: 2014 Inge Wallin <inge@lysator.liu.se> 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef BARWIDGET_H 0008 #define BARWIDGET_H 0009 0010 // Qt 0011 #include <QPaintEvent> 0012 #include <QWidget> 0013 0014 #include "collection.h" // For struct WordCount 0015 #include "utils.h" 0016 0017 extern ConfidenceColors globalColors; 0018 0019 class BarWidget : public QWidget 0020 { 0021 public: 0022 explicit BarWidget(QWidget *parent = nullptr); 0023 explicit BarWidget(WordCount *dueWords, QWidget *parent = nullptr); 0024 0025 void setDue(WordCount &wc); 0026 0027 protected: 0028 void paintEvent(QPaintEvent *) override; 0029 0030 private: 0031 int m_dueWords[8]; 0032 int m_totalDueWords; 0033 int m_percentageCompleted; 0034 }; 0035 0036 #endif // BARWIDGET_H