matrixion/include/ui/LoadingIndicator.h
Max Sandholm 19b526d453 Use system color scheme (using a Qt stylesheet) #104
The color scheme of nheko obeys the default color theme of Qt
(i.e. the system theme). It uses a Qt stylesheet to accomplish this,
which means replacing the color theme with a custom theme would only
be a matter of writing a new style sheet and loading it into the app.
2017-11-16 16:33:52 +02:00

38 lines
766 B
C++

#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_;
};