[gnome-characters] characterList: Avoid redundant redraw



commit cac2b743697d1b1f0a8b040946ff653a2681a6f8
Author: Daiki Ueno <dueno src gnome org>
Date:   Sun Feb 15 17:34:49 2015 +0900

    characterList: Avoid redundant redraw

 src/characterList.js |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/characterList.js b/src/characterList.js
index 4af1651..2f6c754 100644
--- a/src/characterList.js
+++ b/src/characterList.js
@@ -355,17 +355,18 @@ const CharacterListView = new Lang.Class({
     },
 
     setFilterFont: function(family) {
+        let fontDescription;
         if (family == null) {
-            this._filterFontDescription = null;
-            this.updateCharacterList();
-            return;
+            fontDescription = null;
+        } else {
+            fontDescription = Pango.FontDescription.from_string(family);
+            fontDescription.set_size(this._fontDescription.get_size());
         }
 
-        let fontDescription = Pango.FontDescription.from_string(family);
-        fontDescription.set_size(this._fontDescription.get_size());
-
-        if (!(this._filterFontDescription &&
-              fontDescription.equal(this._filterFontDescription))) {
+        if ((this._filterFontDescription != null && fontDescription == null) ||
+            (this._filterFontDescription == null && fontDescription != null) ||
+            (this._filterFontDescription != null && fontDescription != null &&
+             !fontDescription.equal(this._filterFontDescription))) {
             this._filterFontDescription = fontDescription;
             this.updateCharacterList();
         }


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