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
This commit is contained in:
csoler 2013-03-02 21:27:38 +00:00
parent d1b488002e
commit 9bc52689bc

View File

@ -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);
}
}