mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 03:39:39 +03:00
Merge pull request #13246 from jagannatharjun/rss-config
Allow changing RSS article list colors from custom UI theme
This commit is contained in:
commit
91b3ec8380
1 changed files with 6 additions and 2 deletions
|
@ -123,11 +123,15 @@ QListWidgetItem *ArticleListWidget::createItem(RSS::Article *article) const
|
|||
item->setData(Qt::DisplayRole, article->title());
|
||||
item->setData(Qt::UserRole, reinterpret_cast<quintptr>(article));
|
||||
if (article->isRead()) {
|
||||
item->setData(Qt::ForegroundRole, QPalette().color(QPalette::Inactive, QPalette::WindowText));
|
||||
const QColor defaultColor {palette().color(QPalette::Inactive, QPalette::WindowText)};
|
||||
const QBrush foregroundBrush {UIThemeManager::instance()->getColor("RSS.ReadArticle", defaultColor)};
|
||||
item->setData(Qt::ForegroundRole, foregroundBrush);
|
||||
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("sphere")));
|
||||
}
|
||||
else {
|
||||
item->setData(Qt::ForegroundRole, QPalette().color(QPalette::Active, QPalette::Link));
|
||||
const QColor defaultColor {palette().color(QPalette::Active, QPalette::Link)};
|
||||
const QBrush foregroundBrush {UIThemeManager::instance()->getColor("RSS.UnreadArticle", defaultColor)};
|
||||
item->setData(Qt::ForegroundRole, foregroundBrush);
|
||||
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("sphere")));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue