[gnome-maps] mainToolbar: use GdHeaderBar



commit 5de28eedbf11ab626c9f3088d1fee9371617738a
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Mar 25 18:17:27 2013 -0400

    mainToolbar: use GdHeaderBar
    
    Like other GNOME core applications. This will make it easy to add
    buttons or change the header bar layout in the future.

 configure.ac       |    1 +
 libgd              |    2 +-
 src/mainToolbar.js |   15 +++++++--------
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index afdcc7a..cc4074e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,6 +37,7 @@ GJS_CONSOLE=`$PKG_CONFIG --variable=gjs_console gjs-1.0`
 AC_SUBST(GJS_CONSOLE)
 
 LIBGD_INIT([
+  header-bar
   tagged-entry
   gir
 ])
diff --git a/libgd b/libgd
index 29cf577..801ddd1 160000
--- a/libgd
+++ b/libgd
@@ -1 +1 @@
-Subproject commit 29cf577873b0d7d7b4b6250fbb85ee082e003bce
+Subproject commit 801ddd1edd4c88f07468938bd6166e3b2a433730
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index d7ea207..85389bb 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -38,14 +38,13 @@ const MainToolbar = new Lang.Class({
         this._model = null;
         this._mainWindow = mainWindow;
 
-        this.widget = new Gd.TaggedEntry({ width_request: 500 });
-        this.widget.set_halign(Gtk.Align.CENTER);
-        this.widget.set_hexpand(true);
-        this.widget.set_margin_top(10);
-        this.widget.set_margin_bottom(10);
-        this.widget.show();
+        this._entry = new Gd.TaggedEntry({ width_request: 500 });
+        this._entry.show();
 
-        this.widget.connect('activate', Lang.bind(this, this._onSearchActivate));
+        this._entry.connect('activate', Lang.bind(this, this._onSearchActivate));
+
+        this.widget = new Gd.HeaderBar();
+        this.widget.set_custom_title(this._entry);
 
         this._markerLayer = new Champlain.MarkerLayer();
         this._markerLayer.set_selection_mode(Champlain.SelectionMode.SINGLE);
@@ -53,7 +52,7 @@ const MainToolbar = new Lang.Class({
     },
 
     _onSearchActivate: function() {
-        let str = this.widget.get_text();
+        let str = this._entry.get_text();
         let forward = Geocode.Forward.new_for_string(str);
         this._markerLayer.remove_all();
 


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