mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-27 07:47:03 -05:00
added icon for pinned posts and removed colored background
This commit is contained in:
parent
ca94fba8e3
commit
07775e5262
@ -445,11 +445,11 @@ QVariant RsGxsForumModel::textColorRole(const ForumModelPostEntry& fmpe,int /*co
|
|||||||
if( (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING))
|
if( (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING))
|
||||||
return QVariant(mTextColorMissing);
|
return QVariant(mTextColorMissing);
|
||||||
|
|
||||||
if(IS_MSG_UNREAD(fmpe.mMsgStatus))
|
|
||||||
return QVariant(mTextColorUnread);
|
|
||||||
else
|
|
||||||
if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED)
|
if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED)
|
||||||
return QVariant(mTextColorPinned);
|
return QVariant(mTextColorPinned);
|
||||||
|
|
||||||
|
if(IS_MSG_UNREAD(fmpe.mMsgStatus))
|
||||||
|
return QVariant(mTextColorUnread);
|
||||||
else
|
else
|
||||||
return QVariant(mTextColorRead);
|
return QVariant(mTextColorRead);
|
||||||
|
|
||||||
@ -595,8 +595,8 @@ QVariant RsGxsForumModel::pinnedRole(const ForumModelPostEntry& fmpe,int /*colum
|
|||||||
|
|
||||||
QVariant RsGxsForumModel::backgroundRole(const ForumModelPostEntry& fmpe,int /*column*/) const
|
QVariant RsGxsForumModel::backgroundRole(const ForumModelPostEntry& fmpe,int /*column*/) const
|
||||||
{
|
{
|
||||||
if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED)
|
// if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED)
|
||||||
return QVariant(QBrush(mBackgroundColorPinned));
|
// return QVariant(QBrush(mBackgroundColorPinned));
|
||||||
|
|
||||||
if(mFilteringEnabled && (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_PASSES_FILTER))
|
if(mFilteringEnabled && (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_PASSES_FILTER))
|
||||||
return QVariant(QBrush(mBackgroundColorFiltered));
|
return QVariant(QBrush(mBackgroundColorFiltered));
|
||||||
@ -656,8 +656,9 @@ QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) c
|
|||||||
{
|
{
|
||||||
case COLUMN_THREAD_TITLE: if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_REDACTED)
|
case COLUMN_THREAD_TITLE: if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_REDACTED)
|
||||||
return QVariant(tr("[ ... Redacted message ... ]"));
|
return QVariant(tr("[ ... Redacted message ... ]"));
|
||||||
else if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED)
|
// else if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED)
|
||||||
return QVariant(tr("[PINNED] ") + QString::fromUtf8(fmpe.mTitle.c_str()));
|
// return QVariant( QString("<img src=\":/icons/pinned_64.png\" height=%1/>").arg(QFontMetricsF(QFont()).height())
|
||||||
|
// + QString::fromUtf8(fmpe.mTitle.c_str()));
|
||||||
else
|
else
|
||||||
return QVariant(QString::fromUtf8(fmpe.mTitle.c_str()));
|
return QVariant(QString::fromUtf8(fmpe.mTitle.c_str()));
|
||||||
|
|
||||||
|
@ -170,12 +170,15 @@ public:
|
|||||||
// get pixmap
|
// get pixmap
|
||||||
unsigned int read_status = qvariant_cast<uint32_t>(index.data(Qt::DecorationRole));
|
unsigned int read_status = qvariant_cast<uint32_t>(index.data(Qt::DecorationRole));
|
||||||
|
|
||||||
|
bool pinned = index.data(RsGxsForumModel::ThreadPinnedRole).toBool();
|
||||||
bool unread = IS_MSG_UNREAD(read_status);
|
bool unread = IS_MSG_UNREAD(read_status);
|
||||||
bool missing = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::MissingRole).toBool();
|
bool missing = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::MissingRole).toBool();
|
||||||
|
|
||||||
// set icon
|
// set icon
|
||||||
if (missing)
|
if (missing)
|
||||||
icon = QIcon();
|
icon = QIcon();
|
||||||
|
else if(pinned)
|
||||||
|
icon = FilesDefs::getIconFromQtResourcePath(IMAGE_PINPOST);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (unread)
|
if (unread)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user