on xenial help sign in
Pass the scope search hint up to the search line

Approved by: Michael Zanetti

commit237a7756d4674b714ad7a1c6520d6df2d02232c1 authorAlbert Astals <albert.astals@canonical.com> dateMon 11 Aug 2014, 19:03 (12 years ago) parent5e915b426ea6ad
4 files changed+15−1
qml/Components/PageHeader.qml+1 qml/Dash/GenericScopeView.qml+1 tests/mocks/Unity/fake_scope.cpp+1−1 tests/qmltests/Dash/tst_DashContent.qml+12
qml/Components/PageHeader.qml+1
@@ -32,6 +32,7 @@ Item {
3232 property bool searchEntryEnabled: false
3333 property ListModel searchHistory: SearchHistoryModel
3434 property alias searchQuery: searchTextField.text
35+ property alias searchHint: searchTextField.placeholderText
3536 property alias showSignatureLine: bottomBorder.visible
3637
3738 property alias bottomItem: bottomContainer.children
qml/Dash/GenericScopeView.qml+1
@@ -420,6 +420,7 @@ FocusScope {
420420 objectName: "scopePageHeader"
421421 width: parent.width
422422 title: scopeView.scope ? scopeView.scope.name : ""
423+ searchHint: scopeView.scope && scopeView.scope.searchHint || i18n.tr("Search")
423424 showBackButton: scopeView.hasBackAction
424425 searchEntryEnabled: true
425426 scopeStyle: scopeView.scopeStyle
tests/mocks/Unity/fake_scope.cpp+1−1
@@ -69,7 +69,7 @@ QString Scope::description() const
6969
7070QString Scope::searchHint() const
7171{
72− return QString("");
72+ return QString("Search %1").arg(m_name);
7373}
7474
7575QString Scope::shortcut() const
tests/qmltests/Dash/tst_DashContent.qml+12
@@ -380,5 +380,17 @@ Item {
380380 mouseClick(allButton, 0, 0);
381381 tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
382382 }
383+
384+ function test_searchHint() {
385+ var dashContentList = findChild(dashContent, "dashContentList");
386+ verify(dashContentList !== null);
387+ var scope = findChild(dashContent, "MockScope1 loader");
388+ waitForRendering(scope);
389+
390+ var categoryListView = findChild(scope, "categoryListView");
391+ waitForRendering(categoryListView);
392+
393+ compare(categoryListView.pageHeader.searchHint, "Search People");
394+ }
383395 }
384396}