mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 10:35:22 -04:00
Moved most of the hardcoded colors of lists and trees to the file qss.default (with help from braindead).
Now the stylesheet can redefine these colors. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5843 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9c1d702128
commit
a8d1d05405
19 changed files with 387 additions and 104 deletions
|
@ -27,6 +27,7 @@
|
|||
#include "gui/common/StatusDefs.h"
|
||||
#include "gui/common/PeerDefs.h"
|
||||
#include "gui/common/GroupDefs.h"
|
||||
#include "rshare.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsstatus.h>
|
||||
|
@ -40,8 +41,6 @@
|
|||
#define ROLE_ID Qt::UserRole
|
||||
#define ROLE_SORT Qt::UserRole + 1
|
||||
|
||||
#define COLOR_CONNECT Qt::blue
|
||||
|
||||
#define IMAGE_GROUP16 ":/images/user/group16.png"
|
||||
#define IMAGE_FRIENDINFO ":/images/peerdetails_16x16.png"
|
||||
|
||||
|
@ -98,6 +97,9 @@ FriendSelectionWidget::FriendSelectionWidget(QWidget *parent) :
|
|||
|
||||
ui->filterLineEdit->setPlaceholderText(tr("Search Friends"));
|
||||
ui->filterLineEdit->showFilterIcon();
|
||||
|
||||
/* Refresh style to have the correct text color */
|
||||
Rshare::refreshStyleSheet(this, false);
|
||||
}
|
||||
|
||||
FriendSelectionWidget::~FriendSelectionWidget()
|
||||
|
@ -105,6 +107,19 @@ FriendSelectionWidget::~FriendSelectionWidget()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::changeEvent(QEvent *e)
|
||||
{
|
||||
QWidget::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::StyleChange:
|
||||
fillList();
|
||||
break;
|
||||
default:
|
||||
// remove compiler warnings
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::setHeaderText(const QString &text)
|
||||
{
|
||||
ui->friendList->headerItem()->setText(COLUMN_NAME, text);
|
||||
|
@ -253,7 +268,7 @@ void FriendSelectionWidget::fillList()
|
|||
}
|
||||
|
||||
if (state != (int) RS_STATUS_OFFLINE) {
|
||||
item->setTextColor(COLUMN_NAME, COLOR_CONNECT);
|
||||
item->setTextColor(COLUMN_NAME, textColorOnline());
|
||||
}
|
||||
|
||||
item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(state)));
|
||||
|
@ -304,7 +319,7 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
|||
if (item->data(COLUMN_DATA, ROLE_ID).toString() == peerId) {
|
||||
QColor color;
|
||||
if (status != (int) RS_STATUS_OFFLINE) {
|
||||
color = COLOR_CONNECT;
|
||||
color = textColorOnline();
|
||||
}
|
||||
|
||||
item->setTextColor(COLUMN_NAME, color);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue