Add new setting for disabled feeds: Custom color options (#1652)
This commit is contained in:
parent
caccbcb6f8
commit
c8c286507e
3 changed files with 17 additions and 1 deletions
|
@ -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:
|
case Qt::ItemDataRole::ToolTipRole:
|
||||||
if (!qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::EnableTooltipsFeedsMessages)).toBool()) {
|
if (!qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::EnableTooltipsFeedsMessages)).toBool()) {
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
|
@ -649,6 +649,9 @@ QString SkinEnums::palleteColorText(PaletteColors col) {
|
||||||
case SkinEnums::PaletteColors::Allright:
|
case SkinEnums::PaletteColors::Allright:
|
||||||
return QObject::tr("OK-ish color");
|
return QObject::tr("OK-ish color");
|
||||||
|
|
||||||
|
case SkinEnums::PaletteColors::FgDisabledFeed:
|
||||||
|
return QObject::tr("disabled items");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,10 @@ class SkinEnums : public QObject {
|
||||||
FgNewMessages = 32,
|
FgNewMessages = 32,
|
||||||
|
|
||||||
// Foreground color of selected items with new articles.
|
// Foreground color of selected items with new articles.
|
||||||
FgSelectedNewMessages = 64
|
FgSelectedNewMessages = 64,
|
||||||
|
|
||||||
|
// Foreground color of disabled items.
|
||||||
|
FgDisabledFeed = 128
|
||||||
};
|
};
|
||||||
|
|
||||||
static QString palleteColorText(PaletteColors col);
|
static QString palleteColorText(PaletteColors col);
|
||||||
|
|
Loading…
Add table
Reference in a new issue