diff --git a/custom_widgets/yacreader_titled_toolbar.cpp b/custom_widgets/yacreader_titled_toolbar.cpp index 855eee81..e2c71304 100644 --- a/custom_widgets/yacreader_titled_toolbar.cpp +++ b/custom_widgets/yacreader_titled_toolbar.cpp @@ -1,6 +1,7 @@ #include "yacreader_titled_toolbar.h" #include "yacreader_global.h" +#include "yacreader_busy_widget.h" #include #include @@ -69,6 +70,15 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString &title, QWidget *pa setStyleSheet(styleSheet); nameLabel = new DropShadowLabel(this); + busyIndicator = new BusyIndicator(this, 12); + busyIndicator->setIndicatorStyle(BusyIndicator::StyleArc); +#ifdef Y_MAC_UI + busyIndicator->setColor(QColor("#808080")); +#else + busyIndicator->setColor(Qt::white); +#endif + busyIndicator->setHidden(true); + nameLabel->setText(title); #ifdef Y_MAC_UI QString nameLabelStyleSheet = "QLabel {padding:0 0 0 10px; margin:0px; font-size:11px; font-weight:bold;}"; @@ -81,7 +91,8 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString &title, QWidget *pa #endif nameLabel->setStyleSheet(nameLabelStyleSheet); - mainLayout->addWidget(nameLabel, Qt::AlignLeft); + mainLayout->addWidget(nameLabel); + mainLayout->addWidget(busyIndicator); mainLayout->addStretch(); setLayout(mainLayout); @@ -140,3 +151,13 @@ void YACReaderTitledToolBar::addSepartor() mainLayout->addWidget(w); mainLayout->addSpacing(10); } + +void YACReaderTitledToolBar::showBusyIndicator() +{ + busyIndicator->setHidden(false); +} + +void YACReaderTitledToolBar::hideBusyIndicator() +{ + busyIndicator->setHidden(true); +} diff --git a/custom_widgets/yacreader_titled_toolbar.h b/custom_widgets/yacreader_titled_toolbar.h index faa25021..701e2154 100644 --- a/custom_widgets/yacreader_titled_toolbar.h +++ b/custom_widgets/yacreader_titled_toolbar.h @@ -8,6 +8,7 @@ #include class QIcon; +class BusyIndicator; class DropShadowLabel : public QLabel { @@ -38,9 +39,12 @@ public slots: void addAction(QAction *action); void addSpacing(int space); void addSepartor(); + void showBusyIndicator(); + void hideBusyIndicator(); private: DropShadowLabel *nameLabel; + BusyIndicator *busyIndicator; }; #endif // YACREADER_TITLED_TOOLBAR_H