From c40d134508973388c175eaaf42cebacc98ae9888 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 12 Apr 2005 12:27:17 +0000 Subject: [PATCH] Work around the Escape conflict (find bar and unfullscreen) 2005-04-12 Marco Pesenti Gritti * data/evince-ui.xml: * shell/ev-window.c: (ev_window_cmd_escape): Work around the Escape conflict (find bar and unfullscreen) --- ChangeLog | 7 +++++++ data/evince-ui.xml | 2 +- shell/ev-window.c | 20 ++++++++++++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbd7672d..4fc983a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-04-12 Marco Pesenti Gritti + + * data/evince-ui.xml: + * shell/ev-window.c: (ev_window_cmd_escape): + + Work around the Escape conflict (find bar and unfullscreen) + 2005-04-12 Nikolay V. Shmyrev * backend/ev-page-cache.c: (ev_page_cache_next_page): diff --git a/data/evince-ui.xml b/data/evince-ui.xml index 274075c0..738ac4e4 100644 --- a/data/evince-ui.xml +++ b/data/evince-ui.xml @@ -78,5 +78,5 @@ - + diff --git a/shell/ev-window.c b/shell/ev-window.c index 8dd0d6f9..734846ff 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -1658,6 +1658,19 @@ ev_window_cmd_leave_fullscreen (GtkAction *action, EvWindow *window) gtk_window_unfullscreen (GTK_WINDOW (window)); } +static void +ev_window_cmd_escape (GtkAction *action, EvWindow *window) +{ + GtkWidget *widget; + + widget = gtk_window_get_focus (GTK_WINDOW (window)); + if (widget && gtk_widget_get_ancestor (widget, EGG_TYPE_FIND_BAR)) { + update_chrome_flag (window, EV_CHROME_FINDBAR, NULL, FALSE); + } else { + gtk_window_unfullscreen (GTK_WINDOW (window)); + } +} + static void update_view_size (EvWindow *window) { @@ -2152,9 +2165,12 @@ static GtkActionEntry entries[] = { G_CALLBACK (ev_window_cmd_help_about) }, /* Toolbar-only */ - { "LeaveFullscreen", EV_STOCK_LEAVE_FULLSCREEN, N_("Leave Fullscreen"), "Escape", + { "LeaveFullscreen", EV_STOCK_LEAVE_FULLSCREEN, N_("Leave Fullscreen"), NULL, N_("Leave fullscreen mode"), - G_CALLBACK (ev_window_cmd_leave_fullscreen) } + G_CALLBACK (ev_window_cmd_leave_fullscreen) }, + + { "Escape", NULL, N_("Selection Caret"), "Escape", "", + G_CALLBACK (ev_window_cmd_escape) } }; /* Toggle items */ -- 2.43.5