mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 22:26:52 -05:00
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:
parent
d1b488002e
commit
9bc52689bc
@ -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_ID, (qulonglong)id);
|
||||||
item->setData(COLUMN_DATA, ROLE_SUBSCRIBED, subscribed);
|
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) {
|
for (int column = 0; column < COLUMN_COUNT; ++column) {
|
||||||
item->setTextColor(column, subscribed ? QColor() : QColor(Qt::gray));
|
item->setTextColor(column, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user