[polari/wip/raresv/popoverRebasedOnTracker] moved bindings to the template file



commit b037be4af090fed37da27c622597c02fff8e8a6c
Author: raresv <rares visalom gmail com>
Date:   Sun Jul 24 17:27:01 2016 +0300

    moved bindings to the template file

 data/resources/user-popover.ui |    7 +++++++
 src/userList.js                |   13 -------------
 2 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/data/resources/user-popover.ui b/data/resources/user-popover.ui
index c7fa6b8..58fd440 100644
--- a/data/resources/user-popover.ui
+++ b/data/resources/user-popover.ui
@@ -44,6 +44,9 @@
                 <property name="halign">end</property>
                 <property name="valign">center</property>
                 <property name="visible">True</property>
+                <property name="visible" bind-source="notifyButton"
+                          bind-property="sensitive"
+                          bind-flags="sync-create"/>
                 <child>
                   <object class="GtkImage">
                     <property name="icon-name">alarm-symbolic</property>
@@ -59,6 +62,10 @@
         <child>
           <object class="Gjs_UserDetails" id="userDetails">
             <property name="visible">True</property>
+            <property name="expanded">True</property>
+            <property name="notifications-enabled" bind-source="notifyButton"
+                      bind-property="active"
+                      bind-flags="sync-create"/>
           </object>
         </child>
       </object>
diff --git a/src/userList.js b/src/userList.js
index f62253d..d02a86b 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -351,19 +351,6 @@ const UserPopover = new Lang.Class({
 
         this._app = Gio.Application.get_default();
 
-        /* Mmmh, is there a reason to do this? Instead of just having
-              <property name="expanded">True</property>
-         * in the template ... */
-        this.bind_property('visible', this._userDetails, 'expanded', 0);
-
-        /* In any case, you could set up those bindings in the template as
-         * well \o/ */
-        this._notifyButton.bind_property('sensitive',
-                                         this._notifyButton, 'visible', GObject.BindingFlags.SYNC_CREATE);
-        this._notifyButton.bind_property('active',
-                                         this._userDetails, 'notifications-enabled',
-                                         GObject.BindingFlags.SYNC_CREATE);
-
         this._roomStatusChangedId = 0;
         this._globalStatusChangedId = 0;
         this._contactsChangedId = 0;


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