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