Merge pull request #1097 from PhenomRetroShare/Add_MoveFixedColorToQss

Move some Fixed Color to Qss files
This commit is contained in:
csoler 2017-11-05 13:56:39 +01:00 committed by GitHub
commit 8a4c1bddc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 43 additions and 49 deletions

View File

@ -32,9 +32,6 @@
#include <iostream>
#define COLOR_NORMAL QColor(248, 248, 248)
#define COLOR_NEW QColor(220, 236, 253)
/** Constructor */
PostedItem::PostedItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate) :
@ -427,16 +424,9 @@ void PostedItem::setReadStatus(bool isNew, bool isUnread)
ui->newLabel->setVisible(isNew);
/* unpolish widget to clear the stylesheet's palette cache */
ui->mainFrame->style()->unpolish(ui->mainFrame);
QPalette palette = ui->mainFrame->palette();
palette.setColor(ui->mainFrame->backgroundRole(), isNew ? COLOR_NEW : COLOR_NORMAL); // QScrollArea
palette.setColor(QPalette::Base, isNew ? COLOR_NEW : COLOR_NORMAL); // QTreeWidget
ui->mainFrame->setPalette(palette);
ui->mainFrame->setProperty("new", isNew);
Rshare::refreshStyleSheet(ui->mainFrame, false);
ui->mainFrame->style()->unpolish(ui->mainFrame);
ui->mainFrame->style()->polish( ui->mainFrame);
}
void PostedItem::readToggled(bool checked)

View File

@ -44,9 +44,6 @@
* #define DEBUG_ITEM 1
****/
#define COLOR_NORMAL QColor(248, 248, 248)
#define COLOR_NEW QColor(220, 236, 253)
GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate,const std::set<RsGxsMessageId>& older_versions) :
GxsFeedItem(feedHolder, feedId, groupId, messageId, isHome, rsGxsChannels, autoUpdate)
{
@ -69,9 +66,9 @@ void GxsChannelPostItem::init(const RsGxsMessageId& messageId,const std::set<RsG
v.push_back(*it) ;
if(older_versions.find(messageId) == older_versions.end())
v.push_back(messageId);
v.push_back(messageId);
setMessageVersions(v) ;
setMessageVersions(v) ;
setup();
@ -212,10 +209,9 @@ void GxsChannelPostItem::setup()
ui->subjectLabel->setMinimumWidth(100);
ui->warning_label->setMinimumWidth(100);
ui->mainFrame->setProperty("state", "");
QPalette palette = ui->mainFrame->palette();
palette.setColor(ui->mainFrame->backgroundRole(), COLOR_NORMAL);
ui->mainFrame->setPalette(palette);
ui->mainFrame->setProperty("new", false);
ui->mainFrame->style()->unpolish(ui->mainFrame);
ui->mainFrame->style()->polish( ui->mainFrame);
ui->expandFrame->hide();
}
@ -584,16 +580,9 @@ void GxsChannelPostItem::setReadStatus(bool isNew, bool isUnread)
ui->newLabel->setVisible(isNew);
/* unpolish widget to clear the stylesheet's palette cache */
ui->mainFrame->style()->unpolish(ui->mainFrame);
QPalette palette = ui->mainFrame->palette();
palette.setColor(ui->mainFrame->backgroundRole(), isNew ? COLOR_NEW : COLOR_NORMAL); // QScrollArea
palette.setColor(QPalette::Base, isNew ? COLOR_NEW : COLOR_NORMAL); // QTreeWidget
ui->mainFrame->setPalette(palette);
ui->mainFrame->setProperty("new", isNew);
Rshare::refreshStyleSheet(ui->mainFrame, false);
ui->mainFrame->style()->unpolish(ui->mainFrame);
ui->mainFrame->style()->polish( ui->mainFrame);
}
void GxsChannelPostItem::setFileCleanUpWarning(uint32_t time_left)

View File

@ -39,9 +39,6 @@
* #define DEBUG_ITEM 1
****/
#define COLOR_NORMAL QColor(248, 248, 248)
#define COLOR_NEW QColor(220, 236, 253)
#define CIRCLESDIALOG_GROUPUPDATE 3

View File

@ -39,9 +39,6 @@
* #define DEBUG_ITEM 1
****/
#define COLOR_NORMAL QColor(248, 248, 248)
#define COLOR_NEW QColor(220, 236, 253)
GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate) :
GxsFeedItem(feedHolder, feedId, groupId, messageId, isHome, rsGxsForums, autoUpdate)
{
@ -415,16 +412,9 @@ void GxsForumMsgItem::toggle()
void GxsForumMsgItem::setReadStatus(bool isNew, bool /*isUnread*/)
{
/* unpolish widget to clear the stylesheet's palette cache */
ui->frame->style()->unpolish(ui->frame);
QPalette palette = ui->frame->palette();
palette.setColor(ui->frame->backgroundRole(), isNew ? COLOR_NEW : COLOR_NORMAL); // QScrollArea
palette.setColor(QPalette::Base, isNew ? COLOR_NEW : COLOR_NORMAL); // QTreeWidget
ui->frame->setPalette(palette);
ui->frame->setProperty("new", isNew);
Rshare::refreshStyleSheet(ui->frame, false);
ui->frame->style()->unpolish(ui->frame);
ui->frame->style()->polish( ui->frame);
}
void GxsForumMsgItem::requestParentMessage(const RsGxsMessageId &msgId)

View File

@ -76,8 +76,6 @@
#define ROLE_CONTACT_ID Qt::UserRole
#define ROLE_CONTACT_SORT Qt::UserRole + 1
#define COLOR_CONNECT Qt::blue
#define COLUMN_RECIPIENT_TYPE 0
#define COLUMN_RECIPIENT_ICON 1
#define COLUMN_RECIPIENT_NAME 2

View File

@ -243,3 +243,10 @@ OpModeStatus[opMode="Gaming"] {
OpModeStatus[opMode="Minimal"] {
background: #FFCCCC;
}
[new=false] {
background: #F8F8F8;
}
[new=true] {
background: #DCECFD;
}

View File

@ -3,7 +3,7 @@ HeaderFrame {
border: 0px;
}
ForumsDialog
ForumsDialog, GxsForumThreadWidget
{
qproperty-textColorRead: gray;
qproperty-textColorUnread: white;
@ -292,3 +292,10 @@ OpModeStatus[opMode="Gaming"] {
OpModeStatus[opMode="Minimal"] {
background: #700000;
}
[new=false] {
background: #202020;
}
[new=true] {
background: #005000;
}

View File

@ -74,6 +74,15 @@ QWidget:item:selected
stop: 0 #78879b, stop: 1 #78879b);
}
ForumsDialog, GxsForumThreadWidget
{
qproperty-textColorRead: gray;
qproperty-textColorUnread: white;
qproperty-textColorUnreadChildren: gray;
qproperty-textColorNotSubscribed: white;
qproperty-textColorMissing: red;
}
QMenuBar
{
background-color: #302F2F;
@ -1079,3 +1088,10 @@ OpModeStatus[opMode="Gaming"] {
OpModeStatus[opMode="Minimal"] {
background: #700000;
}
[new=false] {
background: #202020;
}
[new=true] {
background: #005000;
}