[polari/wip/fmuellner/combined-gsoc: 47/137] ui: Set up bindings in the .ui file



commit 87cbe05bfa9a65773f82692a13799f77b807fe87
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 22 03:40:51 2016 +0200

    ui: Set up bindings in the .ui file

 data/resources/main-window.ui |    2 ++
 src/mainWindow.js             |   12 ------------
 2 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index 0c49be7..6d923e6 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -54,6 +54,8 @@
                                 <property name="valign">center</property>
                                 <property name="margin-start">5</property>
                                 <property name="margin-end">5</property>
+                                <property name="active" bind-source="searchBar"
+                                          bind-property="search-mode-enabled" 
bind-flags="sync-create|bidirectional"/>
                                 <style>
                                     <class name="image-button"/>
                                 </style>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 51d7b16..fa52ee9 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -102,7 +102,6 @@ const MainWindow = new Lang.Class({
     InternalChildren: ['titlebarRight',
                        'titlebarLeft',
                        'joinButton',
-                       'searchButton',
                        'searchBar',
                        'searchEntry',
                        'showUserListButton',
@@ -220,17 +219,6 @@ const MainWindow = new Lang.Class({
         // search start
         this._keywords = [];
 
-        this.bind_property('search-active',
-                           this._searchButton,
-                           'active',
-                           GObject.BindingFlags.SYNC_CREATE |
-                           GObject.BindingFlags.BIDIRECTIONAL);
-        this.bind_property('search-active',
-                           this._searchBar,
-                           'search-mode-enabled',
-                           GObject.BindingFlags.SYNC_CREATE |
-                           GObject.BindingFlags.BIDIRECTIONAL);
-
         this._searchBar.connect_entry(this._searchEntry);
         this._searchBar.connect('notify::search-mode-enabled',
                                 Lang.bind(this, this._updateMode));


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