mirror of
https://github.com/YACReader/yacreader
synced 2026-03-01 18:33:09 -05:00
Make the YACReaderBusyWidget customizable (color)
This commit is contained in:
@ -9,10 +9,15 @@ YACReaderBusyWidget::YACReaderBusyWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setFixedSize(70, 70);
|
||||
BusyIndicator *busy = new BusyIndicator(this);
|
||||
busy->setIndicatorStyle(BusyIndicator::StyleArc);
|
||||
busy->setColor(Qt::white);
|
||||
busy->move(20, 20);
|
||||
busyIndicator = new BusyIndicator(this);
|
||||
busyIndicator->setIndicatorStyle(BusyIndicator::StyleArc);
|
||||
busyIndicator->setColor(Qt::white);
|
||||
busyIndicator->move(20, 20);
|
||||
}
|
||||
|
||||
void YACReaderBusyWidget::setColor(QColor color)
|
||||
{
|
||||
busyIndicator->setColor(color);
|
||||
}
|
||||
|
||||
BusyIndicator::BusyIndicator(QWidget *parent, int size)
|
||||
@ -48,6 +53,7 @@ void BusyIndicator::setIndicatorStyle(IndicatorStyle style)
|
||||
void BusyIndicator::setColor(QColor color)
|
||||
{
|
||||
fillColor = color;
|
||||
update();
|
||||
}
|
||||
|
||||
BusyIndicator::IndicatorStyle BusyIndicator::indicatorStyle() const
|
||||
|
||||
@ -4,11 +4,17 @@
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
class BusyIndicator;
|
||||
|
||||
class YACReaderBusyWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderBusyWidget(QWidget *parent = 0);
|
||||
void setColor(QColor color);
|
||||
|
||||
private:
|
||||
BusyIndicator *busyIndicator;
|
||||
};
|
||||
|
||||
class BusyIndicator : public QWidget
|
||||
|
||||
Reference in New Issue
Block a user