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);
}