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

Method applyTheme

custom_widgets/yacreader_library_item_widget.cpp:67–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void YACReaderLibraryItemWidget::applyTheme(const Theme &theme)
68{
69 const auto &icons = theme.sidebarIcons;
70 const auto &li = theme.libraryItem;
71
72 // Update icon based on current selection state
73 QIcon iconToUse = isSelected ? li.libraryIconSelected : icons.libraryIcon;
74 icon->setPixmap(iconToUse.pixmap(16, 16));
75
76 // Update options icon (uses libraryItem theme since it's only shown when selected)
77 QPixmap optionsPixmap = li.libraryOptionsIcon.pixmap(8, 8);
78 optionsPixmap.setDevicePixelRatio(devicePixelRatioF());
79 optionsIconLabel->setPixmap(optionsPixmap);
80
81 // Update widget styling based on selection state
82 if (isSelected) {
83 QString styleSheet = QString("color: %1; background-color: %2; font-weight:bold;")
84 .arg(li.selectedTextColor.name())
85 .arg(li.selectedBackgroundColor.name());
86 setStyleSheet(styleSheet);
87 } else {
88 QString styleSheet = QString("background-color:transparent; color: %1;")
89 .arg(li.textColor.name());
90 setStyleSheet(styleSheet);
91 }
92}
93
94void YACReaderLibraryItemWidget::showUpDownButtons(bool show)
95{

Callers

nothing calls this directly

Calls 4

setPixmapMethod · 0.80
pixmapMethod · 0.80
QStringClass · 0.50
nameMethod · 0.45

Tested by

no test coverage detected