From 9bc52689bc9fee8ffc18bdd27dc637e8df4f5eee Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 2 Mar 2013 21:27:38 +0000 Subject: [PATCH] patch from AC to better handle colors in lobby list git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6181 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/ChatLobbyWidget.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 6809ba546..510c4ed76 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include "ChatLobbyWidget.h" #include "chat/CreateLobbyDialog.h" @@ -160,8 +160,15 @@ static void updateItem(QTreeWidgetItem *item, ChatLobbyId id, const std::string item->setData(COLUMN_DATA, ROLE_ID, (qulonglong)id); item->setData(COLUMN_DATA, ROLE_SUBSCRIBED, subscribed); + QColor color = QApplication::palette().color(QPalette::Active, QPalette::Text); + if (!subscribed) { + // Average between Base and Text colors + QColor color2 = QApplication::palette().color(QPalette::Active, QPalette::Base); + color.setRgbF((color2.redF()+color.redF())/2, (color2.greenF()+color.greenF())/2, (color2.blueF()+color.blueF())/2); + } + for (int column = 0; column < COLUMN_COUNT; ++column) { - item->setTextColor(column, subscribed ? QColor() : QColor(Qt::gray)); + item->setTextColor(column, color); } }