fixed bug in coloring of read/unread property

This commit is contained in:
csoler 2018-11-24 22:25:23 +01:00
parent 7384015850
commit 0b0e58bd3d
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 8 additions and 3 deletions

View File

@ -301,8 +301,13 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const
QVariant RsGxsForumModel::textColorRole(const ForumModelPostEntry& fmpe,int column) const QVariant RsGxsForumModel::textColorRole(const ForumModelPostEntry& fmpe,int column) const
{ {
if( (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN) && !IS_MSG_UNREAD(fmpe.mMsgStatus)) if( (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING))
return QVariant(mTextColorUnreadChildren); return QVariant(mTextColorMissing);
if(IS_MSG_UNREAD(fmpe.mMsgStatus))
return QVariant(mTextColorUnread);
else
return QVariant(mTextColorRead);
return QVariant(); return QVariant();
} }

View File

@ -219,7 +219,7 @@ public:
QPixmap pix = icon.pixmap(r.size()); QPixmap pix = icon.pixmap(r.size());
return QSize(pix.width() + fm.width(str),1.2*fm.height()); return QSize(pix.width() + fm.width(str),std::max(1.1*pix.height(),1.4*fm.height()));
} }
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const override virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const override