[gnome-documents] Avoid resetting the titlebar on a realized window



commit b64a90e7b275a2f83df7f6cca455b2a875e93196
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 14 10:22:31 2014 +0100

    Avoid resetting the titlebar on a realized window
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724306

 src/embed.js       |   13 +++++++------
 src/mainToolbar.js |    2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index 5f09657..0d451f9 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -211,6 +211,10 @@ const Embed = new Lang.Class({
         this.widget = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
                                     visible: true });
 
+        let toplevel = Application.application.get_windows()[0];
+        this._titlebar = new Gtk.Grid({ visible: true });
+        toplevel.set_titlebar(this._titlebar);
+
         // create the toolbar for selected items, it's hidden by default
         this._selectionToolbar = new Selections.SelectionToolbar();
         this.widget.pack_end(this._selectionToolbar.widget, false, false, 0);
@@ -439,8 +443,7 @@ const Embed = new Lang.Class({
 
         // pack the toolbar
         this._toolbar = new MainToolbar.OverviewToolbar(this._stackOverlay);
-        let toplevel = Application.application.get_windows()[0];
-        toplevel.set_titlebar(this._toolbar.widget);
+        this._titlebar.add(this._toolbar.widget);
 
         this._spinnerBox.stop();
         this._stack.set_visible_child_name('view');
@@ -454,8 +457,7 @@ const Embed = new Lang.Class({
 
         // pack the toolbar
         this._toolbar = new Preview.PreviewToolbar(this._preview);
-        let toplevel = Application.application.get_windows()[0];
-        toplevel.set_titlebar(this._toolbar.widget);
+        this._titlebar.add(this._toolbar.widget);
     },
 
     _prepareForEdit: function() {
@@ -466,8 +468,7 @@ const Embed = new Lang.Class({
 
         // pack the toolbar
         this._toolbar = new Edit.EditToolbar(this._preview);
-        let toplevel = Application.application.get_windows()[0];
-        toplevel.set_titlebar(this._toolbar.widget);
+        this._titlebar.add(this._toolbar.widget);
 
         this._stack.set_visible_child_name('edit');
     },
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index b89a420..66a3147 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -44,7 +44,7 @@ const MainToolbar = new Lang.Class({
         this.widget = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
         this.widget.show();
 
-        this.toolbar = new Gtk.HeaderBar();
+        this.toolbar = new Gtk.HeaderBar({ hexpand: true });
         this.toolbar.get_style_context().add_class('titlebar');
         this.widget.add(this.toolbar);
         this.toolbar.show();


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