[polari] js: Use :icon-name property on buttons



commit 328871e0e066254fbdd1a031b5f977506ab2509f
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Sep 26 02:38:38 2020 +0200

    js: Use :icon-name property on buttons
    
    This is another trivial, but welcome change: Instead of packing an
    image into a button, we now have a dedicated :icon-name property.
    
    Part-of: <https://gitlab.gnome.org/GNOME/polari/-/merge_requests/235>

 data/resources/join-room-dialog.ui | 7 +------
 data/resources/main-window.ui      | 7 +------
 data/resources/user-popover.ui     | 7 +------
 src/appNotifications.js            | 6 ++++--
 4 files changed, 7 insertions(+), 20 deletions(-)
---
diff --git a/data/resources/join-room-dialog.ui b/data/resources/join-room-dialog.ui
index 9ec5ac32..5999b7fd 100644
--- a/data/resources/join-room-dialog.ui
+++ b/data/resources/join-room-dialog.ui
@@ -12,6 +12,7 @@
         <child>
           <object class="GtkButton" id="backButton">
             <property name="focus-on-click">False</property>
+            <property name="icon-name">go-previous-symbolic</property>
             <child>
               <object class='GtkShortcutController'>
                 <property name='scope'>managed</property>
@@ -23,12 +24,6 @@
                 </child>
               </object>
             </child>
-            <child>
-              <object class="GtkImage">
-                <property name="valign">center</property>
-                <property name="icon-name">go-previous-symbolic</property>
-              </object>
-            </child>
           </object>
         </child>
       </object>
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index f1afd4f2..2ee1d089 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -49,16 +49,11 @@
                 <property name="halign">end</property>
                 <property name="valign">center</property>
                 <property name="action_name">app.show-join-dialog</property>
+                <property name="icon-name">list-add-symbolic</property>
                 <property name="tooltip-text" translatable="yes">Add rooms and networks</property>
                 <style>
                   <class name="image-button"/>
                 </style>
-                <child>
-                  <object class="GtkImage">
-                    <property name="icon-name">list-add-symbolic</property>
-                    <property name="icon-size">1</property>
-                  </object>
-                </child>
                 <accessibility>
                   <property name="label" translatable="yes">Add rooms and networks</property>
                 </accessibility>
diff --git a/data/resources/user-popover.ui b/data/resources/user-popover.ui
index 4352897e..4c3f347a 100644
--- a/data/resources/user-popover.ui
+++ b/data/resources/user-popover.ui
@@ -47,15 +47,10 @@
                 <property name="hexpand">True</property>
                 <property name="halign">end</property>
                 <property name="valign">center</property>
+                <property name="icon-name">polari-user-notify-symbolic</property>
                 <property name="visible" bind-source="notifyButton"
                           bind-property="sensitive"
                           bind-flags="sync-create"/>
-                <child>
-                  <object class="GtkImage">
-                    <property name="icon-name">polari-user-notify-symbolic</property>
-                    <property name="halign">center</property>
-                  </object>
-                </child>
               </object>
             </child>
           </object>
diff --git a/src/appNotifications.js b/src/appNotifications.js
index d3cc04b9..374c5f71 100644
--- a/src/appNotifications.js
+++ b/src/appNotifications.js
@@ -46,8 +46,10 @@ class MessageNotification extends AppNotification {
             ellipsize: Pango.EllipsizeMode.END,
         }));
 
-        let closeButton = new Gtk.Button({ has_frame: false });
-        closeButton.image = new Gtk.Image({ icon_name: 'window-close-symbolic' });
+        let closeButton = new Gtk.Button({
+            icon_name: 'window-close-symbolic',
+            has_frame: false,
+        });
         closeButton.connect('clicked', this.close.bind(this));
         this._box.pack_end(closeButton, false, false, 0);
 


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