Tuning the look of the location search panel with empty search history
authorSami Rämö <sami.ramo@ixonos.com>
Thu, 23 Sep 2010 11:32:27 +0000 (14:32 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Thu, 23 Sep 2010 11:32:27 +0000 (14:32 +0300)
 - History/results label is not shown when there is no search history
   available

 - Changed label text "No search results" -> "No search history"

 - Centered label vertically

src/ui/locationsearchpanel.cpp

index ed60db1..beb9b0c 100644 (file)
@@ -56,8 +56,8 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent)
                                      PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
 
     m_resultsLabel = new QLabel(this);
+    m_resultsLabel->hide();
     headerLayout->addWidget(m_resultsLabel, 0, Qt::AlignCenter);
-    setHeaderText(0);
 
     // --- SEARCH HISTORY LIST VIEW ---
     m_searchHistoryListView = new SearchHistoryListView(this);
@@ -93,7 +93,7 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent)
     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->setText("No search history");
     m_noSearchLabel->setAlignment(Qt::AlignCenter);
 
     QPalette m_noSearchPalette = palette();
@@ -247,9 +247,11 @@ void LocationSearchPanel::showEmptyPanel(bool show)
     if (show) {
         m_noSearchLabel->show();
         m_searchHistoryListView->hide();
+        m_locationListView->hide();
     }
     else {
         m_noSearchLabel->hide();
+        m_resultsLabel->show();
     }
 }