[gnome-characters] Back to the last selected page, when search cancelled



commit 09b370dbd4d74e7feacf938870a73e0f3b395375
Author: Daiki Ueno <dueno src gnome org>
Date:   Fri Oct 3 17:56:27 2014 +0900

    Back to the last selected page, when search cancelled

 src/window.js |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/window.js b/src/window.js
index dbcfd5a..cfc443d 100644
--- a/src/window.js
+++ b/src/window.js
@@ -251,6 +251,11 @@ const MainView = new Lang.Class({
     _startSearch: function() {
         this._cancellable.cancel();
         this._cancellable.reset();
+
+        if (this.visible_child_name != 'search-banner' &&
+            this.visible_child_name != 'search-result')
+            this._lastPage = this.visible_child_name;
+
         this._spinnerTimeoutId =
             GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000,
                              Lang.bind(this, function () {
@@ -274,9 +279,12 @@ const MainView = new Lang.Class({
 
         let characterList = this._characterListWidgets[name];
         characterList.setCharacters(characters);
-        if (result.length == 0)
-            this.visible_child_name = 'search-banner';
-        else {
+        if (result.length == 0) {
+            if (this._lastPage)
+                this.visible_child_name = this._lastPage;
+            else
+                this.visible_child_name = 'search-banner';
+        } else {
             this.visible_child_name = name;
         }
         this.show_all();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]