[gnome-documents] places: Use the builtin GtkHeaderBar in GtkDialog instead of our own



commit 8e1141fab72b52023f369c30e8bac08cc4c239de
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 14 15:36:36 2014 +0100

    places: Use the builtin GtkHeaderBar in GtkDialog instead of our own
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726343

 src/places.js |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/src/places.js b/src/places.js
index 4f81416..4703728 100644
--- a/src/places.js
+++ b/src/places.js
@@ -48,28 +48,21 @@ const PlacesDialog = new Lang.Class({
                                         transient_for: toplevel,
                                         modal: true,
                                         destroy_with_parent: true,
+                                        use_header_bar: true,
                                         default_width: 600, // FIXME use toplevel size
                                         default_height: 600,
                                         title: "",
                                         hexpand: true });
-
-        this._header = new Gtk.HeaderBar();
-        this.widget.set_titlebar(this._header);
-
-        let button = new Gd.HeaderSimpleButton({ label: _("Close") });
-        this._header.pack_end(button);
-        button.connect('clicked', Lang.bind(this,
-            function() {
-                this.widget.response(Gtk.ResponseType.CLOSE);
-            }));
+        this.widget.add_button(_("Close"), Gtk.ResponseType.CLOSE);
 
         let contentArea = this.widget.get_content_area();
         this._stack = new Gtk.Stack({ border_width: 5,
                                       homogeneous: true });
         contentArea.pack_start(this._stack, true, true, 0);
 
+        let header = this.widget.get_header_bar();
         let switcher = new Gtk.StackSwitcher({ stack: this._stack });
-        this._header.set_custom_title(switcher);
+        header.set_custom_title(switcher);
 
         this._linksPage = new GdPrivate.PlacesLinks();
         this._linksPage.connect('link-activated', Lang.bind(this,


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