friendListPanelLayout->setSpacing(0);
setLayout(friendListPanelLayout);
+ m_noFriendsLabel = new QLabel();
+ m_noFriendsLabel->setText("No Friends");
+ m_noFriendsLabel->setAlignment(Qt::AlignCenter);
+
+ QPalette noFriendsPalette = palette();
+ noFriendsPalette.setColor(QPalette::Foreground, Qt::white);
+ m_noFriendsLabel->setPalette(noFriendsPalette);
+
+ friendListPanelLayout->addWidget(m_noFriendsLabel, Qt::AlignCenter);
friendListPanelLayout->addWidget(m_headerWidget);
friendListPanelLayout->addLayout(listViewLayout);
friendListPanelLayout->addLayout(footerLayout);
m_itemButtonsLayout->addWidget(m_routeButton);
m_itemButtonsLayout->addWidget(m_showContactButton);
m_genericButtonsLayout->addWidget(m_clearGroupFilteringButton);
+
+ showEmptyPanel(true);
}
void FriendListPanel::anyPanelClosed()
{
qDebug() << __PRETTY_FUNCTION__;
+ if (!friendList.isEmpty())
+ showEmptyPanel(false);
+
QStringList newUserIDs;
foreach (User *user, friendList) {
}
m_friendListView->clearUnused(newUserIDs);
+ m_friendListView->show();
}
void FriendListPanel::hideEvent(QHideEvent *event)
setFilteringLayoutVisibility(false);
}
+void FriendListPanel::showEmptyPanel(bool show)
+{
+ if (show){
+ m_noFriendsLabel->show();
+ m_friendListView->hide();
+ }
+ else {
+ m_noFriendsLabel->hide();
+ }
+}
+
void FriendListPanel::showFriendsInList(const QList<QString> &userIDs)
{
qDebug() << __PRETTY_FUNCTION__;