[gnome-documents] window: don't reset the view when setting the same window mode



commit 2e9662139330b0a10b3be53c111843a1e011f871
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Sep 2 19:15:28 2011 -0400

    window: don't reset the view when setting the same window mode
    
    But we need to ensure it's destroyed when setting the preview widget,
    as we could be switching from the same window mode.

 src/mainWindow.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index d7c1674..013674d 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -223,14 +223,16 @@ MainWindow.prototype = {
     },
 
     _setWindowMode: function(windowMode) {
+        if (this._windowMode == windowMode)
+            return;
+
         this._windowMode = windowMode;
+        this._toolbar.setWindowMode(this._windowMode);
 
         if (this._windowMode == WindowMode.OVERVIEW)
             this._prepareForOverview();
         else
             this._prepareForPreview();
-
-        this._toolbar.setWindowMode(this._windowMode);
     },
 
     _prepareForPreview: function(model, document) {
@@ -376,6 +378,7 @@ MainWindow.prototype = {
         this._preview.widget.connect('motion-notify-event',
                                      Lang.bind(this, this._fullscreenMotionHandler));
 
+        this._destroyView();
         this._scrolledWin.add(this._preview.widget);
     },
 



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