MCPcopy Create free account
hub / github.com/YACReader/yacreader / applyTheme

Method applyTheme

YACReaderLibrary/import_widget.cpp:378–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378void ImportWidget::applyTheme(const Theme &theme)
379{
380 const auto &importTheme = theme.importWidget;
381
382 // Covers toggle button
383 hideButton->setIcon(importTheme.coversToggleIcon);
384 hideButton->setIconSize(hideButton->size());
385
386 // Background
387 QPalette p(palette());
388 p.setColor(QPalette::Window, importTheme.backgroundColor);
389 setPalette(p);
390
391 // Covers view background
392 coversView->setStyleSheet(QString("QGraphicsView {background-color: %1; border:none;}")
393 .arg(importTheme.coversViewBackgroundColor.name()));
394
395 // Covers decorations
396 topDecorator->setPixmap(importTheme.topCoversDecoration);
397 topDecorator->setFixedHeight(importTheme.topCoversDecoration.height());
398 bottomDecorator->setPixmap(importTheme.bottomCoversDecoration);
399 bottomDecorator->setFixedHeight(importTheme.bottomCoversDecoration.height());
400
401 const auto &noLibrariesWidget = theme.noLibrariesWidget;
402 activityIndicator->setPixmaps(noLibrariesWidget.noLibrariesLinePixmap, importTheme.glowLinePixmap);
403
404 // Apply text colors
405 updateTextColors();
406}
407
408void ImportWidget::updateTextColors()
409{

Callers

nothing calls this directly

Calls 6

setIconMethod · 0.80
setPixmapMethod · 0.80
setPixmapsMethod · 0.80
QStringClass · 0.70
setColorMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected