mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-24 17:00:27 -05:00
gxsforums: add background color for pinned and filtered posts into qss
This commit is contained in:
parent
98cf944f92
commit
b265cdf284
@ -596,10 +596,10 @@ 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(QColor(255,200,180)));
|
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(QColor(255,240,210)));
|
return QVariant(QBrush(mBackgroundColorFiltered));
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,9 @@ public:
|
|||||||
void setTextColorMissing (QColor color) { mTextColorMissing = color;}
|
void setTextColorMissing (QColor color) { mTextColorMissing = color;}
|
||||||
void setTextColorPinned (QColor color) { mTextColorPinned = color;}
|
void setTextColorPinned (QColor color) { mTextColorPinned = color;}
|
||||||
|
|
||||||
|
void setBackgroundColorPinned (QColor color) { mBackgroundColorPinned = color;}
|
||||||
|
void setBackgroundColorFiltered (QColor color) { mBackgroundColorFiltered = color;}
|
||||||
|
|
||||||
void setMsgReadStatus(const QModelIndex &i, bool read_status, bool with_children);
|
void setMsgReadStatus(const QModelIndex &i, bool read_status, bool with_children);
|
||||||
void setFilter(int column, const QStringList &strings, uint32_t &count) ;
|
void setFilter(int column, const QStringList &strings, uint32_t &count) ;
|
||||||
void setAuthorOpinion(const QModelIndex& indx,RsOpinion op);
|
void setAuthorOpinion(const QModelIndex& indx,RsOpinion op);
|
||||||
@ -205,5 +208,8 @@ private:
|
|||||||
QColor mTextColorMissing ;
|
QColor mTextColorMissing ;
|
||||||
QColor mTextColorPinned ;
|
QColor mTextColorPinned ;
|
||||||
|
|
||||||
|
QColor mBackgroundColorPinned;
|
||||||
|
QColor mBackgroundColorFiltered;
|
||||||
|
|
||||||
friend class const_iterator;
|
friend class const_iterator;
|
||||||
};
|
};
|
||||||
|
@ -219,6 +219,9 @@ void GxsForumThreadWidget::setTextColorMissing (QColor color) { mTextColor
|
|||||||
// Suppose to be different from unread one
|
// Suppose to be different from unread one
|
||||||
void GxsForumThreadWidget::setTextColorPinned (QColor color) { mTextColorPinned = color; mThreadModel->setTextColorPinned (color);}
|
void GxsForumThreadWidget::setTextColorPinned (QColor color) { mTextColorPinned = color; mThreadModel->setTextColorPinned (color);}
|
||||||
|
|
||||||
|
void GxsForumThreadWidget::setBackgroundColorPinned (QColor color) { mBackgroundColorPinned = color; mThreadModel->setBackgroundColorPinned (color);}
|
||||||
|
void GxsForumThreadWidget::setBackgroundColorFiltered(QColor color) { mBackgroundColorFiltered = color; mThreadModel->setBackgroundColorFiltered (color);}
|
||||||
|
|
||||||
GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget *parent) :
|
GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget *parent) :
|
||||||
GxsMessageFrameWidget(rsGxsForums, parent),
|
GxsMessageFrameWidget(rsGxsForums, parent),
|
||||||
ui(new Ui::GxsForumThreadWidget)
|
ui(new Ui::GxsForumThreadWidget)
|
||||||
|
@ -54,6 +54,9 @@ class GxsForumThreadWidget : public GxsMessageFrameWidget
|
|||||||
Q_PROPERTY(QColor textColorMissing READ textColorMissing WRITE setTextColorMissing)
|
Q_PROPERTY(QColor textColorMissing READ textColorMissing WRITE setTextColorMissing)
|
||||||
Q_PROPERTY(QColor textColorPinned READ textColorPinned WRITE setTextColorPinned)
|
Q_PROPERTY(QColor textColorPinned READ textColorPinned WRITE setTextColorPinned)
|
||||||
|
|
||||||
|
Q_PROPERTY(QColor backgroundColorPinned READ backgroundColorPinned WRITE setBackgroundColorPinned)
|
||||||
|
Q_PROPERTY(QColor backgroundColorFiltered READ backgroundColorFiltered WRITE setBackgroundColorFiltered)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget *parent = NULL);
|
explicit GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget *parent = NULL);
|
||||||
~GxsForumThreadWidget();
|
~GxsForumThreadWidget();
|
||||||
@ -65,6 +68,9 @@ public:
|
|||||||
QColor textColorMissing() const { return mTextColorMissing; }
|
QColor textColorMissing() const { return mTextColorMissing; }
|
||||||
QColor textColorPinned() const { return mTextColorPinned; }
|
QColor textColorPinned() const { return mTextColorPinned; }
|
||||||
|
|
||||||
|
QColor backgroundColorPinned() const { return mBackgroundColorPinned; }
|
||||||
|
QColor backgroundColorFiltered() const { return mBackgroundColorFiltered; }
|
||||||
|
|
||||||
void setTextColorRead (QColor color) ;
|
void setTextColorRead (QColor color) ;
|
||||||
void setTextColorUnread (QColor color) ;
|
void setTextColorUnread (QColor color) ;
|
||||||
void setTextColorUnreadChildren(QColor color) ;
|
void setTextColorUnreadChildren(QColor color) ;
|
||||||
@ -72,6 +78,9 @@ public:
|
|||||||
void setTextColorMissing (QColor color) ;
|
void setTextColorMissing (QColor color) ;
|
||||||
void setTextColorPinned (QColor color) ;
|
void setTextColorPinned (QColor color) ;
|
||||||
|
|
||||||
|
void setBackgroundColorPinned (QColor color);
|
||||||
|
void setBackgroundColorFiltered (QColor color);
|
||||||
|
|
||||||
/* GxsMessageFrameWidget */
|
/* GxsMessageFrameWidget */
|
||||||
virtual void groupIdChanged();
|
virtual void groupIdChanged();
|
||||||
virtual QString groupName(bool withUnreadCount);
|
virtual QString groupName(bool withUnreadCount);
|
||||||
@ -212,6 +221,9 @@ private:
|
|||||||
QColor mTextColorMissing;
|
QColor mTextColorMissing;
|
||||||
QColor mTextColorPinned;
|
QColor mTextColorPinned;
|
||||||
|
|
||||||
|
QColor mBackgroundColorPinned;
|
||||||
|
QColor mBackgroundColorFiltered;
|
||||||
|
|
||||||
RsGxsMessageId mNavigatePendingMsgId;
|
RsGxsMessageId mNavigatePendingMsgId;
|
||||||
QList<RsGxsMessageId> mIgnoredMsgId;
|
QList<RsGxsMessageId> mIgnoredMsgId;
|
||||||
|
|
||||||
|
@ -139,6 +139,9 @@ ForumsDialog, GxsForumThreadWidget
|
|||||||
qproperty-textColorNotSubscribed: black;
|
qproperty-textColorNotSubscribed: black;
|
||||||
qproperty-textColorMissing: darkRed;
|
qproperty-textColorMissing: darkRed;
|
||||||
qproperty-textColorPinned: darkOrange;
|
qproperty-textColorPinned: darkOrange;
|
||||||
|
|
||||||
|
qproperty-backgroundColorPinned: rgb(255, 200, 180);
|
||||||
|
qproperty-backgroundColorFiltered: rgb(255, 240, 210);
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupTreeWidget
|
GroupTreeWidget
|
||||||
|
@ -94,6 +94,9 @@ ForumsDialog, GxsForumThreadWidget
|
|||||||
qproperty-textColorNotSubscribed: white;
|
qproperty-textColorNotSubscribed: white;
|
||||||
qproperty-textColorMissing: darkred;
|
qproperty-textColorMissing: darkred;
|
||||||
qproperty-textColorPinned: darkOrange;
|
qproperty-textColorPinned: darkOrange;
|
||||||
|
|
||||||
|
qproperty-backgroundColorPinned: black;
|
||||||
|
qproperty-backgroundColorFiltered: darkGreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMenuBar
|
QMenuBar
|
||||||
|
Loading…
x
Reference in New Issue
Block a user