| 65 | } |
| 66 | |
| 67 | void 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 | |
| 94 | void YACReaderLibraryItemWidget::showUpDownButtons(bool show) |
| 95 | { |