[gnome-documents] application: disable view-as action when previewing



commit 5e8349db5aec00bfb109702e5c5b2bf43c74b0e3
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu May 31 14:04:10 2012 -0400

    application: disable view-as action when previewing
    
    It doesn't make sense to display the list/grid choice as active when
    we're previewing a document, as it only affects the overview.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677140

 src/application.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index afab1f4..3c57750 100644
--- a/src/application.js
+++ b/src/application.js
@@ -121,6 +121,11 @@ Application.prototype = {
             function() {
                 viewAsAction.state = Global.settings.get_value('view-as');
             }));
+        Global.modeController.connect('window-mode-changed', Lang.bind(this,
+            function() {
+                let mode = Global.modeController.getWindowMode();
+                viewAsAction.set_enabled(mode == WindowMode.WindowMode.OVERVIEW);
+            }));
         this.application.add_action(viewAsAction);
 
 	let menu = new Gio.Menu();



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