[gnome-documents] Drop Gd.HeaderMenuButton



commit f7cc8e6027c2d41eaff29b8244f0cc813a424c5e
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jul 24 18:08:34 2014 +0200

    Drop Gd.HeaderMenuButton
    
    A Gd.HeaderMenuButton is a Gtk.MenuButton that either has a 16px icon,
    tooltip text and the image-button style class; or a label and the
    text-button style class.
    
    Gtk.Button does not offer a use-markup property so we need to set it
    directly on the child Gtk.Label. We also need to guard against NULL
    strings because Gtk.Button.set_label is not marked as 'allow-none'.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733683

 src/mainToolbar.js |   13 ++++++++-----
 src/preview.js     |    6 +++---
 2 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index 9adea27..a1ed411 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -177,10 +177,14 @@ const OverviewToolbar = new Lang.Class({
                 primary = label;
         }
 
-        if (this._selectionMenu)
-            this._selectionMenu.set_label(primary);
-        else
+        if (this._selectionMenu) {
+            if (primary) {
+                this._selectionMenu.set_label(primary);
+                this._selectionMenu.get_child().use_markup = true;
+            }
+        } else {
             this.toolbar.set_title(primary);
+        }
     },
 
     _populateForSelectionMode: function() {
@@ -189,8 +193,7 @@ const OverviewToolbar = new Lang.Class({
         let builder = new Gtk.Builder();
         builder.add_from_resource('/org/gnome/documents/selection-menu.ui');
         let selectionMenu = builder.get_object('selection-menu');
-        this._selectionMenu = new Gd.HeaderMenuButton({ menu_model: selectionMenu,
-                                                        use_markup: true });
+        this._selectionMenu = new Gtk.MenuButton({ menu_model: selectionMenu });
         this._selectionMenu.get_style_context().add_class('selection-menu');
         this.toolbar.set_custom_title(this._selectionMenu);
 
diff --git a/src/preview.js b/src/preview.js
index 91551c4..4bfa170 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -807,9 +807,9 @@ const PreviewToolbar = new Lang.Class({
 
         // menu button, on the right of the toolbar
         let previewMenu = this._getPreviewMenu();
-        let menuButton = new Gd.HeaderMenuButton({ menu_model: previewMenu,
-                                                   action_name: 'app.gear-menu',
-                                                   symbolic_icon_name: 'open-menu-symbolic' });
+        let menuButton = new Gtk.MenuButton({ image: new Gtk.Image ({ icon_name: 'open-menu-symbolic' }),
+                                              menu_model: previewMenu,
+                                              action_name: 'app.gear-menu' });
         this.toolbar.pack_end(menuButton);
 
         // search button, on the right of the toolbar


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