summary refs log tree commit diff
path: root/src/ui/LoadingIndicator.h
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
commit0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a (patch)
tree21f655d30630fe77ba48d07e4b357e2b6c6a5730 /src/ui/LoadingIndicator.h
parentMerge pull request #372 from bebehei/notification (diff)
downloadnheko-0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a.tar.xz
Move all files under src/
Diffstat (limited to 'src/ui/LoadingIndicator.h')
-rw-r--r--src/ui/LoadingIndicator.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ui/LoadingIndicator.h b/src/ui/LoadingIndicator.h
new file mode 100644

index 00000000..bb33fe6c --- /dev/null +++ b/src/ui/LoadingIndicator.h
@@ -0,0 +1,38 @@ +#pragma once + +#include <QColor> +#include <QPaintEvent> +#include <QPainter> +#include <QTimer> +#include <QWidget> + +class LoadingIndicator : public QWidget +{ + Q_OBJECT + Q_PROPERTY(QColor color READ color WRITE setColor) + +public: + LoadingIndicator(QWidget *parent = 0); + virtual ~LoadingIndicator(); + + void paintEvent(QPaintEvent *e); + + void start(); + void stop(); + + QColor color() { return color_; } + void setColor(QColor color) { color_ = color; } + + int interval() { return interval_; } + void setInterval(int interval) { interval_ = interval; } + +private slots: + void onTimeout(); + +private: + int interval_; + int angle_; + + QColor color_; + QTimer *timer_; +};