Add new setting for disabled feeds: Custom color options (#1652)

This commit is contained in:
رشيد 2025-02-28 10:41:11 +00:00 committed by GitHub
parent caccbcb6f8
commit c8c286507e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 1 deletions

View file

@ -564,6 +564,16 @@ QVariant FeedsModel::data(const QModelIndex& index, int role) const {
}
}
case Qt::ItemDataRole::ForegroundRole: {
RootItem* it = itemForIndex(index);
if (it->kind() == RootItem::Kind::Feed && qobject_cast<Feed*>(it)->isSwitchedOff()) {
return qApp->settings()->value(GROUP(CustomSkinColors), SETTING(CustomSkinColors::Enabled)).toBool()
? qApp->skins()->colorForModel(SkinEnums::PaletteColors::FgDisabledFeed)
: QColor("#d1d1d1");
}
}
case Qt::ItemDataRole::ToolTipRole:
if (!qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::EnableTooltipsFeedsMessages)).toBool()) {
return QVariant();

View file

@ -649,6 +649,9 @@ QString SkinEnums::palleteColorText(PaletteColors col) {
case SkinEnums::PaletteColors::Allright:
return QObject::tr("OK-ish color");
case SkinEnums::PaletteColors::FgDisabledFeed:
return QObject::tr("disabled items");
default:
return {};
}

View file

@ -41,7 +41,10 @@ class SkinEnums : public QObject {
FgNewMessages = 32,
// Foreground color of selected items with new articles.
FgSelectedNewMessages = 64
FgSelectedNewMessages = 64,
// Foreground color of disabled items.
FgDisabledFeed = 128
};
static QString palleteColorText(PaletteColors col);