[evince] Add shortcut keys for best-fit and fit-width options
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] Add shortcut keys for best-fit and fit-width options
- Date: Sun, 26 Jun 2011 10:03:14 +0000 (UTC)
commit 2ed0f3d442525367c92510062babbe7558d0966e
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sun Jun 26 12:01:10 2011 +0200
Add shortcut keys for best-fit and fit-width options
'f' for best-fit for consistency with eog and 'w' for fit-width.
Fixes bug #595571.
data/evince-ui.xml | 2 ++
shell/ev-window.c | 20 +++++++++++++++++++-
2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/data/evince-ui.xml b/data/evince-ui.xml
index 3aca084..b1e4984 100644
--- a/data/evince-ui.xml
+++ b/data/evince-ui.xml
@@ -131,6 +131,8 @@
<accelerator name="CtrlKpPlusAccel" action="CtrlKpPlus"/>
<accelerator name="CtrlKpMinusAccel" action="CtrlKpMinus"/>
<accelerator name="CtrlInsertAccel" action="CtrlInsert" />
+ <accelerator name="BestFitAccel" action ="BestFit" />
+ <accelerator name="PageWidthAccel" action ="PageWidth" />
<toolbar name="FullscreenToolbar">
<toolitem name="GoPreviousPage" action="GoPreviousPage"/>
diff --git a/shell/ev-window.c b/shell/ev-window.c
index ca3c1bb..5aded70 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -571,7 +571,9 @@ static const gchar *view_accels[] = {
"KpPlus",
"KpMinus",
"Equal",
- "p"
+ "p",
+ "BestFit",
+ "PageWidth"
};
static void
@@ -3774,6 +3776,12 @@ ev_window_cmd_view_best_fit (GtkAction *action, EvWindow *ev_window)
}
static void
+ev_window_cmd_best_fit (GtkAction *action, EvWindow *ev_window)
+{
+ ev_document_model_set_sizing_mode (ev_window->priv->model, EV_SIZING_BEST_FIT);
+}
+
+static void
ev_window_cmd_view_page_width (GtkAction *action, EvWindow *ev_window)
{
ev_window_stop_presentation (ev_window, TRUE);
@@ -3786,6 +3794,12 @@ ev_window_cmd_view_page_width (GtkAction *action, EvWindow *ev_window)
ev_window_update_actions (ev_window);
}
+static void
+ev_window_cmd_page_width (GtkAction *action, EvWindow *ev_window)
+{
+ ev_document_model_set_sizing_mode (ev_window->priv->model, EV_SIZING_FIT_WIDTH);
+}
+
static void
ev_window_cmd_edit_select_all (GtkAction *action, EvWindow *ev_window)
@@ -5842,6 +5856,10 @@ static const GtkActionEntry entries[] = {
G_CALLBACK (ev_window_cmd_view_zoom_out) },
{ "CtrlInsert", GTK_STOCK_COPY, NULL, "<control>Insert", NULL,
G_CALLBACK (ev_window_cmd_edit_copy) },
+ { "BestFit", EV_STOCK_ZOOM_PAGE, NULL, "f", NULL,
+ G_CALLBACK (ev_window_cmd_best_fit) },
+ { "PageWidth", EV_STOCK_ZOOM_WIDTH, NULL, "w", NULL,
+ G_CALLBACK (ev_window_cmd_page_width) },
};
/* Toggle items */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]