mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04: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
1 changed files with 9 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
||||||
#include <QTextBrowser>
|
#include <QTextBrowser>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "ChatLobbyWidget.h"
|
#include "ChatLobbyWidget.h"
|
||||||
#include "chat/CreateLobbyDialog.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_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…
Add table
Add a link
Reference in a new issue