mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Allow changing RSS article list colors from custom UI theme
Use ArticleListWidget own palette to obtain default colors
This commit is contained in:
parent
4d1c5a8aea
commit
a63ca5f0c4
@ -123,11 +123,15 @@ QListWidgetItem *ArticleListWidget::createItem(RSS::Article *article) const
|
|||||||
item->setData(Qt::DisplayRole, article->title());
|
item->setData(Qt::DisplayRole, article->title());
|
||||||
item->setData(Qt::UserRole, reinterpret_cast<quintptr>(article));
|
item->setData(Qt::UserRole, reinterpret_cast<quintptr>(article));
|
||||||
if (article->isRead()) {
|
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")));
|
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("sphere")));
|
||||||
}
|
}
|
||||||
else {
|
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")));
|
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("sphere")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user