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__;
void routeToSelectedFriend();
/**
+ * @brief show / hide empty panel label
+ *
+ * @param show true if empty panel should be shown
+ */
+ void showEmptyPanel(bool show);
+
+ /**
* @brief Slot to show friends in list.
*
* Shows only friends that are on userIDs list
bool m_somePanelIsOpen; ///< Is any panel tab open
QLabel *m_headerLabel; ///< Show how many friends are selected
+ QLabel *m_noFriendsLabel; ///< Text label for empty panel
QLineEdit *m_filterField; ///< Text field for the filter text
const int MARGIN_LEFT = 0;
panelLayout->setContentsMargins(MARGIN_LEFT, PANEL_MARGIN_TOP,
PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
+ m_noSearchLabel = new QLabel();
+ m_noSearchLabel->setText("No Search Results");
+ m_noSearchLabel->setAlignment(Qt::AlignCenter);
+
+ QPalette m_noSearchPalette = palette();
+ m_noSearchPalette.setColor(QPalette::Foreground, Qt::white);
+ m_noSearchLabel->setPalette(m_noSearchPalette);
panelLayout->addWidget(resultsHeaderWidget);
+ panelLayout->addWidget(m_noSearchLabel, Qt::AlignCenter);
panelLayout->addLayout(resultsListViewLayout);
// --- CONTEXT BUTTONS ---
readSettings();
showSearchHistoryListView();
+ showEmptyPanel(true);
}
LocationSearchPanel::~LocationSearchPanel()
emit routeToLocation(item->coordinates());
}
+void LocationSearchPanel::showEmptyPanel(bool show)
+{
+ if (show){
+ m_noSearchLabel->show();
+ m_searchHistoryListView->hide();
+ }
+ else {
+ m_noSearchLabel->hide();
+ }
+}
+
void LocationSearchPanel::setHeaderText(int count)
{
qDebug() << __PRETTY_FUNCTION__;
setHeaderText(locationItemsCount);
m_clearLocationListButton->setEnabled(true);
m_locationListView->show();
+ showEmptyPanel(false);
}
void LocationSearchPanel::showSearchHistoryListView()
m_resultsLabel->setText(tr("Search history:"));
m_clearLocationListButton->setDisabled(true);
m_searchHistoryListView->show();
+ showEmptyPanel(false);
}
void clearListsSelections();
/**
+ * @brief show / hide empty panel label
+ *
+ * @param show true if empty panel should be shown
+ */
+ void showEmptyPanel(bool show);
+
+ /**
* @brief Shows location list view.
*
* @param locationItemsCount location items count
* DATA MEMBERS
******************************************************************************/
private:
+ QLabel *m_noSearchLabel; ///< Text label for empty panel
QLabel *m_resultsLabel; ///< Location list label
ImageButton *m_clearLocationListButton; ///< Clear location list button
panelLayout->setContentsMargins(PANEL_MARGIN_LEFT, PANEL_MARGIN_TOP,
PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
+ m_noRouteLabel = new QLabel();
+ m_noRouteLabel->setText("No Route");
+ m_noRouteLabel->setAlignment(Qt::AlignCenter);
+
+ QPalette noRoutePalette = palette();
+ noRoutePalette.setColor(QPalette::Foreground, Qt::white);
+ m_noRouteLabel->setPalette(noRoutePalette);
+
panelLayout->addWidget(m_routeWaypointListView);
+ panelLayout->addWidget(m_noRouteLabel, Qt::AlignCenter);
+ m_routeWaypointListView->hide();
setLayout(panelLayout);
// --- CONTEXT BUTTONS ---
m_clearRouteButton->setDisabled(true);
m_routeWaypointListView->clearList();
+ m_routeWaypointListView->hide();
+ m_noRouteLabel->show();
emit clearRoute();
}
qDebug() << __PRETTY_FUNCTION__;
m_routeWaypointListView->clearList();
+ m_noRouteLabel->hide();
QList<RouteSegment> segments = route.segments();
QList<GeoCoordinate> geometryPoints = route.geometryPoints();
geometryPoints.at(routeSegment.positionIndex()));
m_routeWaypointListView->addListItem(QString::number(i), item);
+ m_routeWaypointListView->show();
}
m_routeWaypointListView->scrollToTop();
* DATA MEMBERS
******************************************************************************/
private:
+ QLabel *m_noRouteLabel; ///< Text label for empty panel
QLabel *m_resultsLabel; ///< Location list label
ImageButton *m_clearRouteButton; ///< Search location button