[gnome-documents] all: Get rid of the WM's titlebar



commit 65e878570d44638812d346a5db0cf3bfd7589e7d
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Aug 5 16:53:38 2013 +0200

    all: Get rid of the WM's titlebar
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705520

 configure.ac       |    2 +-
 src/edit.js        |    1 +
 src/embed.js       |   16 ++++++----------
 src/mainToolbar.js |    2 ++
 src/preview.js     |    1 +
 5 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1378699..5792b96 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,7 @@ AC_SUBST(LIBM)
 EVINCE_MIN_VERSION=3.7.4
 WEBKITGTK_MIN_VERSION=1.10.0
 GLIB_MIN_VERSION=2.37.0
-GTK_MIN_VERSION=3.9.10
+GTK_MIN_VERSION=3.9.11
 GOBJECT_INTROSPECTION_MIN_VERSION=1.31.6
 GDATA_MIN_VERSION=0.13.3
 GOA_MIN_VERSION=3.2.0
diff --git a/src/edit.js b/src/edit.js
index 4d3fbab..ade8632 100644
--- a/src/edit.js
+++ b/src/edit.js
@@ -180,6 +180,7 @@ const EditToolbar = new Lang.Class({
         this._editView = editView;
 
         this.parent();
+        this.toolbar.set_show_close_button(true);
 
         // back button, on the left of the toolbar
         let backButton = this.addBackButton();
diff --git a/src/embed.js b/src/embed.js
index 68eb07a..5e1e047 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -425,12 +425,10 @@ const Embed = new Lang.Class({
         if (this._edit)
             this._edit.setUri(null);
 
-        if (this._toolbar)
-            this._toolbar.widget.destroy();
-
         // pack the toolbar
         this._toolbar = new MainToolbar.OverviewToolbar(this._stackOverlay);
-        this.widget.pack_start(this._toolbar.widget, false, false, 0);
+        let toplevel = Application.application.get_windows()[0];
+        toplevel.set_titlebar(this._toolbar.widget);
 
         this._spinnerBox.stop();
         this._stack.set_visible_child_name('view');
@@ -439,23 +437,21 @@ const Embed = new Lang.Class({
     _prepareForPreview: function() {
         if (this._edit)
             this._edit.setUri(null);
-        if (this._toolbar)
-            this._toolbar.widget.destroy();
 
         // pack the toolbar
         this._toolbar = new Preview.PreviewToolbar(this._preview);
-        this.widget.pack_start(this._toolbar.widget, false, false, 0);
+        let toplevel = Application.application.get_windows()[0];
+        toplevel.set_titlebar(this._toolbar.widget);
     },
 
     _prepareForEdit: function() {
         if (this._preview)
             this._preview.setModel(null);
-        if (this._toolbar)
-            this._toolbar.widget.destroy();
 
         // pack the toolbar
         this._toolbar = new Edit.EditToolbar(this._preview);
-        this.widget.pack_start(this._toolbar.widget, false, false, 0);
+        let toplevel = Application.application.get_windows()[0];
+        toplevel.set_titlebar(this._toolbar.widget);
 
         this._stack.set_visible_child_name('edit');
     },
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index 34ee6d0..2c00f02 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -242,6 +242,7 @@ const OverviewToolbar = new Lang.Class({
     },
 
     _populateForOverview: function() {
+        this.toolbar.set_show_close_button(true);
         this._checkCollectionBackButton();
         this.addSearchButton();
 
@@ -277,6 +278,7 @@ const OverviewToolbar = new Lang.Class({
 
     _clearToolbar: function() {
         this._clearStateData();
+        this.toolbar.set_show_close_button(false);
 
         this.toolbar.get_style_context().remove_class('selection-mode');
         let children = this.toolbar.get_children();
diff --git a/src/preview.js b/src/preview.js
index b95567c..2cc40e2 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -815,6 +815,7 @@ const PreviewToolbar = new Lang.Class({
         this._previewView = previewView;
 
         this.parent();
+        this.toolbar.set_show_close_button(true);
 
         this._searchAction = Application.application.lookup_action('search');
         this._gearMenu = Application.application.lookup_action('gear-menu');


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