From 1cb2f50057644770ead941e85c2fea848e04d37d Mon Sep 17 00:00:00 2001 From: luisangelsm Date: Wed, 14 Jan 2026 15:52:11 +0100 Subject: [PATCH] Make the YACReaderBusyWidget customizable (color) --- custom_widgets/yacreader_busy_widget.cpp | 14 ++++++++++---- custom_widgets/yacreader_busy_widget.h | 6 ++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/custom_widgets/yacreader_busy_widget.cpp b/custom_widgets/yacreader_busy_widget.cpp index 10550e34..0ef081b3 100644 --- a/custom_widgets/yacreader_busy_widget.cpp +++ b/custom_widgets/yacreader_busy_widget.cpp @@ -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 diff --git a/custom_widgets/yacreader_busy_widget.h b/custom_widgets/yacreader_busy_widget.h index 5963c4d2..c7a37c6e 100644 --- a/custom_widgets/yacreader_busy_widget.h +++ b/custom_widgets/yacreader_busy_widget.h @@ -4,11 +4,17 @@ #include #include +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