Make the YACReaderBusyWidget customizable (color)

This commit is contained in:
luisangelsm
2026-01-14 15:52:11 +01:00
parent 721da42c8c
commit 1cb2f50057
2 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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