Extract noLibrariesWidget theme and use themed line assets
Some checks failed
Build / Initialization (push) Has been cancelled
Build / Code Format Validation (push) Has been cancelled
Build / Linux (Qt6) (push) Has been cancelled
Build / Linux (Qt6 + 7zip) (push) Has been cancelled
Build / macOS (Qt6 Universal) (push) Has been cancelled
Build / Windows x64 (Qt6) (push) Has been cancelled
Build / Windows ARM64 (Qt6) (push) Has been cancelled
Build / Docker amd64 Image (push) Has been cancelled
Build / Docker arm64 Image (push) Has been cancelled
Build / Publish Dev Builds (push) Has been cancelled
Build / Publish Release (push) Has been cancelled
Build / Publish YACReader10 Pre-release Builds (push) Has been cancelled

This commit is contained in:
luisangelsm
2026-03-21 20:55:23 +01:00
parent f65fd08e65
commit 2560174a84
14 changed files with 228 additions and 54 deletions

View File

@ -23,6 +23,8 @@ class YACReaderActivityIndicatorWidget : public QWidget
{
public:
YACReaderActivityIndicatorWidget(QWidget *parent = 0);
void setPixmaps(const QPixmap &normalLine, const QPixmap &glowLine);
public slots:
private:
@ -31,16 +33,11 @@ private:
};
YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget *parent)
: QWidget(parent)
: QWidget(parent), normal(nullptr), glow(nullptr)
{
QPixmap line(":/images/noLibrariesLine.png");
QPixmap glowLine(":/images/glowLine.png");
normal = new QLabel(this);
glow = new QLabel(this);
normal->setPixmap(line);
glow->setPixmap(glowLine);
auto layout = new QHBoxLayout();
layout->addWidget(normal, 0, Qt::AlignVCenter);
@ -50,11 +47,6 @@ YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget *pare
layout->setContentsMargins(4, 4, 4, 4);
layout->setSpacing(0);
// setFixedHeight(3);
// resize(579,3);
glow->setGeometry(4, 4, glowLine.width(), glowLine.height());
// normal->setGeometry(0,1,579,1);
auto effect = new QGraphicsOpacityEffect();
// effect->setOpacity(1.0);
@ -80,6 +72,13 @@ YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget *pare
animation->start();
}
void YACReaderActivityIndicatorWidget::setPixmaps(const QPixmap &normalLine, const QPixmap &glowLine)
{
normal->setPixmap(normalLine);
glow->setPixmap(glowLine);
glow->setGeometry(4, 4, glowLine.width(), glowLine.height());
}
ImportWidget::ImportWidget(QWidget *parent)
: QWidget(parent)
{
@ -88,7 +87,7 @@ ImportWidget::ImportWidget(QWidget *parent)
iconLabel = new QLabel();
auto activityIndicator = new YACReaderActivityIndicatorWidget();
activityIndicator = new YACReaderActivityIndicatorWidget();
text = new QLabel();
textDescription = new QLabel();
@ -399,6 +398,9 @@ void ImportWidget::applyTheme(const Theme &theme)
bottomDecorator->setPixmap(importTheme.bottomCoversDecoration);
bottomDecorator->setFixedHeight(importTheme.bottomCoversDecoration.height());
const auto &noLibrariesWidget = theme.noLibrariesWidget;
activityIndicator->setPixmaps(noLibrariesWidget.noLibrariesLinePixmap, importTheme.glowLinePixmap);
// Apply text colors
updateTextColors();
}