[gnome-characters] menu: Reset filter font upon closing popover
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters] menu: Reset filter font upon closing popover
- Date: Sun, 15 Feb 2015 06:03:19 +0000 (UTC)
commit 92c81d9c9c04d02e50063865c9f7ed1d971579c0
Author: Daiki Ueno <dueno src gnome org>
Date: Sun Feb 15 15:02:51 2015 +0900
menu: Reset filter font upon closing popover
src/characterList.js | 1 +
src/menu.js | 7 +++++++
src/window.js | 2 ++
3 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/characterList.js b/src/characterList.js
index 288e4bc..58694a9 100644
--- a/src/characterList.js
+++ b/src/characterList.js
@@ -357,6 +357,7 @@ const CharacterListView = new Lang.Class({
setFilterFont: function(family) {
if (family == null) {
this._filterFontDescription = null;
+ this.updateCharacterList();
return;
}
diff --git a/src/menu.js b/src/menu.js
index 8d8a440..526798d 100644
--- a/src/menu.js
+++ b/src/menu.js
@@ -58,6 +58,13 @@ const MenuPopover = new Lang.Class({
// This silents warning at Characters exit about this widget being
// visible but not mapped. Borrowed from Maps.
this.connect('unmap', function(popover) { popover.hide(); });
+
+ // Reset filter font when this popover is closed.
+ this.connect('hide', function(popover) {
+ let toplevel = popover.get_toplevel();
+ let action = toplevel.lookup_action('filter-font');
+ action.activate(new GLib.Variant('s', ''));
+ });
},
_handleSearchChanged: function(entry) {
diff --git a/src/window.js b/src/window.js
index 299e192..623cc9e 100644
--- a/src/window.js
+++ b/src/window.js
@@ -199,6 +199,8 @@ const MainWindow = new Lang.Class({
_filterFont: function(action, v) {
let [family, length] = v.get_string()
+ if (family == '')
+ family = null;
this._mainView.setFilterFont(family);
this._updateTitle(this._mainView.visible_child.title, family);
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]