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:
thunder2 2012-11-19 16:01:21 +00:00
parent 9c1d702128
commit a8d1d05405
19 changed files with 387 additions and 104 deletions

View file

@ -31,6 +31,11 @@ class QToolButton;
class RshareSettings;
class RSTreeWidgetItemCompareRole;
#define GROUPTREEWIDGET_COLOR_STANDARD -1
#define GROUPTREEWIDGET_COLOR_CATEGORY 0
#define GROUPTREEWIDGET_COLOR_PRIVATEKEY 1
#define GROUPTREEWIDGET_COLOR_COUNT 2
namespace Ui {
class GroupTreeWidget;
}
@ -58,6 +63,9 @@ class GroupTreeWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(QColor textColorCategory READ textColorCategory WRITE setTextColorCategory)
Q_PROPERTY(QColor textColorPrivateKey READ textColorPrivateKey WRITE setTextColorPrivateKey)
public:
GroupTreeWidget(QWidget *parent = 0);
~GroupTreeWidget();
@ -79,6 +87,12 @@ public:
QTreeWidgetItem *getItemFromId(const QString &id);
QTreeWidgetItem *activateId(const QString &id, bool focus);
QColor textColorCategory() const { return mTextColor[GROUPTREEWIDGET_COLOR_CATEGORY]; }
QColor textColorPrivateKey() const { return mTextColor[GROUPTREEWIDGET_COLOR_PRIVATEKEY]; }
void setTextColorCategory(QColor color) { mTextColor[GROUPTREEWIDGET_COLOR_CATEGORY] = color; }
void setTextColorPrivateKey(QColor color) { mTextColor[GROUPTREEWIDGET_COLOR_PRIVATEKEY] = color; }
signals:
void treeCustomContextMenuRequested(const QPoint &pos);
void treeCurrentItemChanged(const QString &id);
@ -96,6 +110,7 @@ private slots:
private:
void calculateScore(QTreeWidgetItem *item, const QString &filterText);
void resort(QTreeWidgetItem *categoryItem);
void updateColors();
private:
QMenu *displayMenu;
@ -107,6 +122,9 @@ private:
RSTreeWidgetItemCompareRole *compareRole;
/* Color definitions (for standard see qss.default) */
QColor mTextColor[GROUPTREEWIDGET_COLOR_COUNT];
Ui::GroupTreeWidget *ui;
};