From 1293da2206e8247c520d6d0c3cb4eb616531b2dd Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 17 Feb 2021 11:52:29 +0100 Subject: [PATCH] Fix NewFriendList item Font defined in QSS --- retroshare-gui/src/gui/common/FriendListModel.cpp | 4 ++++ retroshare-gui/src/gui/common/NewFriendList.cpp | 2 +- retroshare-gui/src/gui/qss/stylesheet/Standard.qss | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index a7cfb8f0d..653c3485b 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -608,6 +608,10 @@ QVariant RsFriendListModel::fontRole(const EntryIndex& e, int col) const case RS_STATUS_INACTIVE: { QFont font ; + QTreeView* myParent = dynamic_cast(QAbstractItemModel::parent()); + if (myParent) + font = myParent->font(); + font.setBold(true); return QVariant(font); diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 561f7b524..a23687651 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -183,7 +183,7 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par rsEvents->registerEventsHandler( [this](std::shared_ptr e) { handleEvent(e); }, mEventHandlerId_peer, RsEventType::PEER_CONNECTION ); rsEvents->registerEventsHandler( [this](std::shared_ptr e) { handleEvent(e); }, mEventHandlerId_gssp, RsEventType::GOSSIP_DISCOVERY ); - mModel = new RsFriendListModel(); + mModel = new RsFriendListModel(ui->peerTreeWidget); mProxyModel = new FriendListSortFilterProxyModel(ui->peerTreeWidget->header(),this); mProxyModel->setSourceModel(mModel); diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 97376aeab..9afecbdc5 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -1205,7 +1205,10 @@ BoardsCommentsItem QLabel#subjectLabel, QLabel#titleLabel , QLabel#nameLabel { font: bold; } -NewFriendList QTreeView#peerTreeWidget::item:selected { +NewFriendList QTreeView#peerTreeWidget::item:selected, QTreeView#peerTreeWidget::branch:selected { background-color: #cde8ff; } +NewFriendList QTreeView#peerTreeWidget { + font-size: 1.2em; +}