[gnome-documents] Ensure that icon-only buttons get the 'image-button' style class



commit 3efff6f5fffd023be6dc2a21acbb6809dcecbd0b
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Aug 11 16:37:55 2014 +0200

    Ensure that icon-only buttons get the 'image-button' style class
    
    Due to the way Gtk.Button works, when a Gtk.Image is added via the
    'child' property the button does not get the 'image-button' style
    class attached to it. We need to add it via the 'image' property for
    that to happen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734620

 src/notifications.js |    4 ++--
 src/preview.js       |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/notifications.js b/src/notifications.js
index 74f57ab..b32c77d 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -130,7 +130,7 @@ const PrintNotification = new Lang.Class({
         this._progressBar = new Gtk.ProgressBar();
         this.widget.add(this._progressBar);
 
-        this._stopButton = new Gtk.Button({ child: new Gtk.Image({ icon_name: 'process-stop-symbolic',
+        this._stopButton = new Gtk.Button({ image: new Gtk.Image({ icon_name: 'process-stop-symbolic',
                                                                    pixel_size: 16,
                                                                    margin_top: 2,
                                                                    margin_bottom: 2 }),
@@ -272,7 +272,7 @@ const IndexingNotification = new Lang.Class({
         this._secondaryLabel.get_style_context().add_class('dim-label');
         labels.add(this._secondaryLabel);
 
-        let close = new Gtk.Button({ child: new Gtk.Image({ icon_name: 'window-close-symbolic',
+        let close = new Gtk.Button({ image: new Gtk.Image({ icon_name: 'window-close-symbolic',
                                                             pixel_size: 16,
                                                             margin_top: 2,
                                                             margin_bottom: 2 }),
diff --git a/src/preview.js b/src/preview.js
index 7ae294e..a09ec93 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -574,7 +574,7 @@ const PreviewNavControls = new Lang.Class({
         let buttonArea = this.bar_widget.get_button_area();
 
         let button = new Gtk.Button({ action_name: 'app.places',
-                                      child: new Gtk.Image({ icon_name: 'view-list-symbolic',
+                                      image: new Gtk.Image({ icon_name: 'view-list-symbolic',
                                                              pixel_size: 16 }),
                                       valign: Gtk.Align.CENTER,
                                       tooltip_text: _("Bookmarks")
@@ -582,14 +582,14 @@ const PreviewNavControls = new Lang.Class({
         buttonArea.pack_start(button, false, false, 0);
 
         button = new Gtk.ToggleButton({ action_name: 'app.bookmark-page',
-                                        child: new Gtk.Image({ icon_name: 'bookmark-add-symbolic',
+                                        image: new Gtk.Image({ icon_name: 'bookmark-add-symbolic',
                                                                pixel_size: 16 }),
                                         valign: Gtk.Align.CENTER,
                                         tooltip_text: _("Bookmark this page")
                                       });
         buttonArea.pack_start(button, false, false, 0);
 
-        this.prev_widget = new Gtk.Button({ child: new Gtk.Image ({ icon_name: 'go-previous-symbolic',
+        this.prev_widget = new Gtk.Button({ image: new Gtk.Image ({ icon_name: 'go-previous-symbolic',
                                                                     pixel_size: 16 }),
                                             margin_start: _PREVIEW_NAVBAR_MARGIN,
                                             margin_end: _PREVIEW_NAVBAR_MARGIN,
@@ -601,7 +601,7 @@ const PreviewNavControls = new Lang.Class({
         this.prev_widget.connect('enter-notify-event', Lang.bind(this, this._onEnterNotify));
         this.prev_widget.connect('leave-notify-event', Lang.bind(this, this._onLeaveNotify));
 
-        this.next_widget = new Gtk.Button({ child: new Gtk.Image ({ icon_name: 'go-next-symbolic',
+        this.next_widget = new Gtk.Button({ image: new Gtk.Image ({ icon_name: 'go-next-symbolic',
                                                                     pixel_size: 16 }),
                                             margin_start: _PREVIEW_NAVBAR_MARGIN,
                                             margin_end: _PREVIEW_NAVBAR_MARGIN,


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