[evince] ev-toolbar: Remove state for presentation action



commit 9d393846a13c743e11858d031b72ef54bb8d231e
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Tue Jul 3 21:34:27 2018 -0400

    ev-toolbar: Remove state for presentation action
    
    With a state, the action becomes a toggle that may
    be confusing in the menu because the user never sees the
    menu activated (menu is hidden on presentation mode).
    
    Additionally, we still can determine whether the window
    is in presentation mode.

 shell/ev-window.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index e964b1b7..ae5c5047 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4410,16 +4410,6 @@ ev_window_uninhibit_screensaver (EvWindow *window)
         priv->presentation_mode_inhibit_id = 0;
 }
 
-static void
-ev_window_update_presentation_action (EvWindow *window)
-{
-       GAction *action;
-
-       action = g_action_map_lookup_action (G_ACTION_MAP (window), "presentation");
-       g_simple_action_set_state (G_SIMPLE_ACTION (action),
-                                  g_variant_new_boolean (EV_WINDOW_IS_PRESENTATION (window)));
-}
-
 static void
 ev_window_view_presentation_finished (EvWindow *window)
 {
@@ -4485,7 +4475,6 @@ ev_window_run_presentation (EvWindow *window)
                            TRUE, TRUE, 0);
 
        gtk_widget_hide (window->priv->hpaned);
-       ev_window_update_presentation_action (window);
        update_chrome_visibility (window);
 
        gtk_widget_grab_focus (window->priv->presentation_view);
@@ -4520,7 +4509,6 @@ ev_window_stop_presentation (EvWindow *window,
        window->priv->presentation_view = NULL;
 
        gtk_widget_show (window->priv->hpaned);
-       ev_window_update_presentation_action (window);
        update_chrome_visibility (window);
        if (unfullscreen_window)
                gtk_window_unfullscreen (GTK_WINDOW (window));
@@ -4540,9 +4528,8 @@ ev_window_cmd_view_presentation (GSimpleAction *action,
 {
        EvWindow *window = user_data;
 
-       if (g_variant_get_boolean (state)) {
+       if (!EV_WINDOW_IS_PRESENTATION (window))
                ev_window_run_presentation (window);
-       }
        /* We don't exit presentation when action is toggled because it conflicts with some
         * remote controls. The behaviour is also consistent with libreoffice and other
         * presentation tools. See https://bugzilla.gnome.org/show_bug.cgi?id=556162
@@ -5949,7 +5936,7 @@ static const GActionEntry actions[] = {
        { "inverted-colors", NULL, NULL, "false", ev_window_cmd_view_inverted_colors },
        { "enable-spellchecking", NULL, NULL, "false", ev_window_cmd_view_enable_spellchecking },
        { "fullscreen", NULL, NULL, "false", ev_window_cmd_view_fullscreen },
-       { "presentation", NULL, NULL, "false", ev_window_cmd_view_presentation },
+       { "presentation", ev_window_cmd_view_presentation },
        { "rotate-left", ev_window_cmd_edit_rotate_left },
        { "rotate-right", ev_window_cmd_edit_rotate_right },
        { "zoom-in", ev_window_cmd_view_zoom_in },


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