polished off feed coloring a bit
This commit is contained in:
parent
c8c286507e
commit
d75aed4af1
2 changed files with 13 additions and 17 deletions
|
@ -554,7 +554,7 @@ QVariant FeedsModel::data(const QModelIndex& index, int role) const {
|
||||||
case Qt::ItemDataRole::FontRole: {
|
case Qt::ItemDataRole::FontRole: {
|
||||||
RootItem* it = itemForIndex(index);
|
RootItem* it = itemForIndex(index);
|
||||||
bool is_bold = it->countOfUnreadMessages() > 0;
|
bool is_bold = it->countOfUnreadMessages() > 0;
|
||||||
bool is_striked = it->kind() == RootItem::Kind::Feed ? qobject_cast<Feed*>(it)->isSwitchedOff() : false;
|
bool is_striked = it->kind() == RootItem::Kind::Feed ? it->toFeed()->isSwitchedOff() : false;
|
||||||
|
|
||||||
if (is_bold) {
|
if (is_bold) {
|
||||||
return is_striked ? m_boldStrikedFont : m_boldFont;
|
return is_striked ? m_boldStrikedFont : m_boldFont;
|
||||||
|
@ -564,21 +564,6 @@ 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
case Qt::ItemDataRole::DecorationRole: {
|
case Qt::ItemDataRole::DecorationRole: {
|
||||||
if (index.column() == FDS_MODEL_TITLE_INDEX && m_updateDuringFetching) {
|
if (index.column() == FDS_MODEL_TITLE_INDEX && m_updateDuringFetching) {
|
||||||
RootItem* it = itemForIndex(index);
|
RootItem* it = itemForIndex(index);
|
||||||
|
@ -589,6 +574,12 @@ QVariant FeedsModel::data(const QModelIndex& index, int role) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Qt::ItemDataRole::ToolTipRole:
|
||||||
|
// NOTE: Fall-down to "default" if condition not met.
|
||||||
|
if (!qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::EnableTooltipsFeedsMessages)).toBool()) {
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return itemForIndex(index)->data(index.column(), role);
|
return itemForIndex(index)->data(index.column(), role);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,11 @@ QVariant Feed::data(int column, int role) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case Qt::ItemDataRole::ForegroundRole:
|
case Qt::ItemDataRole::ForegroundRole: {
|
||||||
|
if (isSwitchedOff()) {
|
||||||
|
return qApp->skins()->colorForModel(SkinEnums::PaletteColors::FgDisabledFeed);
|
||||||
|
}
|
||||||
|
|
||||||
switch (status()) {
|
switch (status()) {
|
||||||
case Status::NewMessages:
|
case Status::NewMessages:
|
||||||
return qApp->skins()->colorForModel(SkinEnums::PaletteColors::FgNewMessages);
|
return qApp->skins()->colorForModel(SkinEnums::PaletteColors::FgNewMessages);
|
||||||
|
@ -107,6 +111,7 @@ QVariant Feed::data(int column, int role) const {
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return RootItem::data(column, role);
|
return RootItem::data(column, role);
|
||||||
|
|
Loading…
Add table
Reference in a new issue