From 69c8aef6c275a989c9f28a695b8d7fc2a738c830 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 6 Jan 2010 15:00:49 -0500 Subject: [PATCH] Show "No matching results" if that's the case This also fixes backtracking from no matching results. https://bugzilla.gnome.org/show_bug.cgi?id=606209 --- js/ui/dash.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/js/ui/dash.js b/js/ui/dash.js index e50c8538c..0d941a7ff 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -433,9 +433,8 @@ SearchResults.prototype = { this.actor = new St.BoxLayout({ name: 'dashSearchResults', vertical: true }); - this._searchingNotice = new St.Label({ style_class: 'dash-search-starting', - text: _("Searching...") }); - this.actor.add(this._searchingNotice); + this._statusText = new St.Label({ style_class: 'dash-search-statustext' }); + this.actor.add(this._statusText); this._selectedProvider = -1; this._providers = this._searchSystem.getProviders(); this._providerMeta = []; @@ -485,13 +484,14 @@ SearchResults.prototype = { reset: function() { this._searchSystem.reset(); - this._searchingNotice.hide(); + this._statusText.hide(); this._clearDisplay(); }, startingSearch: function() { this.reset(); - this._searchingNotice.show(); + this._statusText.set_text(_("Searching...")); + this._statusText.show(); }, _metaForProvider: function(provider) { @@ -501,9 +501,16 @@ SearchResults.prototype = { updateSearch: function (searchString) { let results = this._searchSystem.updateSearch(searchString); - this._searchingNotice.hide(); this._clearDisplay(); + if (results.length == 0) { + this._statusText.set_text(_("No matching results.")); + this._statusText.show(); + return true; + } else { + this._statusText.hide(); + } + let terms = this._searchSystem.getTerms(); for (let i = 0; i < results.length; i++) {