diff --git a/src/designer/loading_indicator.ui b/src/designer/loading_indicator.ui index 8cc12af..8b6875f 100644 --- a/src/designer/loading_indicator.ui +++ b/src/designer/loading_indicator.ui @@ -11,14 +11,8 @@ - + - - - 500 - 16777215 - - 24 diff --git a/src/loading_indicator.cpp b/src/loading_indicator.cpp index fe2bae4..1b297f9 100644 --- a/src/loading_indicator.cpp +++ b/src/loading_indicator.cpp @@ -1,14 +1,16 @@ /* * @Author: Uyanide pywang0608@foxmail.com * @Date: 2025-08-07 00:32:25 - * @LastEditTime: 2025-08-07 21:14:09 + * @LastEditTime: 2026-01-15 05:23:55 * @Description: LoadingIndicator implementation. */ #include "loading_indicator.h" -LoadingIndicator::LoadingIndicator(QWidget* parent) : QWidget(parent), - ui(new Ui::LoadingIndicator) { +LoadingIndicator::LoadingIndicator(int barMinimumWidth, QWidget* parent) + : QWidget(parent), + ui(new Ui::LoadingIndicator) { ui->setupUi(this); + ui->progressBar->setMinimumWidth(barMinimumWidth); } LoadingIndicator::~LoadingIndicator() { diff --git a/src/loading_indicator.h b/src/loading_indicator.h index 1a7addb..a3cfd1d 100644 --- a/src/loading_indicator.h +++ b/src/loading_indicator.h @@ -1,7 +1,7 @@ /* * @Author: Uyanide pywang0608@foxmail.com * @Date: 2025-08-07 00:32:25 - * @LastEditTime: 2025-08-07 21:13:59 + * @LastEditTime: 2026-01-15 05:24:14 * @Description: A loading indicator widget with a progress bar. */ #ifndef LOADING_INDICATOR_H @@ -19,7 +19,7 @@ class LoadingIndicator : public QWidget { Q_OBJECT public: - explicit LoadingIndicator(QWidget* parent = nullptr); + explicit LoadingIndicator(int barMinimumWidth = 500, QWidget* parent = nullptr); ~LoadingIndicator(); void setMaximum(int max) { ui->progressBar->setMaximum(max); } diff --git a/src/main_window.cpp b/src/main_window.cpp index eb5a668..6448789 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -1,7 +1,7 @@ /* * @Author: Uyanide pywang0608@foxmail.com * @Date: 2025-08-05 00:37:58 - * @LastEditTime: 2026-01-15 02:01:19 + * @LastEditTime: 2026-01-15 05:26:49 * @Description: MainWindow implementation. */ #include "main_window.h" @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "./ui_main_window.h" @@ -50,7 +51,8 @@ void MainWindow::_setupUI() { m_carouselIndex = ui->stackedWidget->addWidget(m_carousel); // create loading indicator - m_loadingIndicator = new LoadingIndicator(this); + int barWidth = m_config.getStyleConfig().windowWidth * 0.7; + m_loadingIndicator = new LoadingIndicator(barWidth, this); connect(m_carousel, &ImagesCarousel::loadingStarted, this,