diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2005-05-10 15:48:46 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2005-05-10 15:48:46 (GMT) |
commit | f7d8183b26d763d0501f40720aed357d5aa35029 (patch) | |
tree | 9cbfe5089ea4377b3eb3a4919d983dee80a3816e | |
parent | 11368f9b50db86ce4f2ae0b549fb575a19af2a74 (diff) |
Add mnemonic for edit toolbar. ctrl+l focus the page entry.
2005-05-10 Marco Pesenti Gritti <mpg@redhat.com>
* data/evince-ui.xml:
* shell/ev-page-action.c: (ev_page_action_grab_focus):
* shell/ev-page-action.h:
* shell/ev-window.c: (ev_window_cmd_focus_page_selector):
Add mnemonic for edit toolbar.
ctrl+l focus the page entry.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | data/evince-ui.xml | 1 | ||||
-rw-r--r-- | shell/ev-page-action.c | 14 | ||||
-rw-r--r-- | shell/ev-page-action.h | 2 | ||||
-rw-r--r-- | shell/ev-window.c | 29 |
5 files changed, 47 insertions, 9 deletions
@@ -1,5 +1,15 @@ 2005-05-10 Marco Pesenti Gritti <mpg@redhat.com> + * data/evince-ui.xml: + * shell/ev-page-action.c: (ev_page_action_grab_focus): + * shell/ev-page-action.h: + * shell/ev-window.c: (ev_window_cmd_focus_page_selector): + + Add mnemonic for edit toolbar. + ctrl+l focus the page entry. + +2005-05-10 Marco Pesenti Gritti <mpg@redhat.com> + * lib/Makefile.am: * shell/ev-window.c: (ev_window_cmd_edit_toolbar_cb), (ev_window_init): diff --git a/data/evince-ui.xml b/data/evince-ui.xml index bd9566d..3875322 100644 --- a/data/evince-ui.xml +++ b/data/evince-ui.xml @@ -69,5 +69,6 @@ <accelerator name="BackSpaceAccel" action="BackSpace"/> <accelerator name="ShiftSpaceAccel" action="ShiftSpace"/> <accelerator name="ShiftBackSpaceAccel" action="ShiftBackSpace"/> + <accelerator name="FocusPageSelectorAccel" action="FocusPageSelector"/> </ui> diff --git a/shell/ev-page-action.c b/shell/ev-page-action.c index 57b9bfc..8ba9d77 100644 --- a/shell/ev-page-action.c +++ b/shell/ev-page-action.c @@ -534,6 +534,20 @@ ev_page_action_set_model (EvPageAction *page_action, NULL); } +void +ev_page_action_grab_focus (EvPageAction *page_action) +{ + GSList *proxies; + + proxies = gtk_action_get_proxies (GTK_ACTION (page_action)); + for (; proxies != NULL; proxies = proxies->next) { + EvPageActionWidget *proxy; + + proxy = EV_PAGE_ACTION_WIDGET (proxies->data); + gtk_widget_grab_focus (proxy->entry); + } +} + static void ev_page_action_init (EvPageAction *page) { diff --git a/shell/ev-page-action.h b/shell/ev-page-action.h index 636a24d..8ac0d54 100644 --- a/shell/ev-page-action.h +++ b/shell/ev-page-action.h @@ -60,7 +60,7 @@ void ev_page_action_set_document (EvPageAction *page_action, EvDocument *document); void ev_page_action_set_model (EvPageAction *page_action, GtkTreeModel *model); - +void ev_page_action_grab_focus (EvPageAction *page_action); G_END_DECLS diff --git a/shell/ev-window.c b/shell/ev-window.c index 2db012d..fe1c226 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -339,6 +339,16 @@ update_chrome_flag (EvWindow *window, EvChrome flag, const char *pref, gboolean } static void +ev_window_cmd_focus_page_selector (GtkAction *act, EvWindow *window) +{ + GtkAction *action; + + action = gtk_action_group_get_action (window->priv->action_group, + PAGE_SELECTOR_ACTION); + ev_page_action_grab_focus (EV_PAGE_ACTION (action)); +} + +static void ev_window_cmd_scroll_forward (GtkAction *action, EvWindow *window) { ev_view_scroll (EV_VIEW (window->priv->view), EV_SCROLL_PAGE_FORWARD); @@ -2335,8 +2345,8 @@ static const GtkActionEntry entries[] = { { "EditFindNext", NULL, N_("Find Ne_xt"), "<control>G", N_("Find next occurrence of the word or phrase"), G_CALLBACK (ev_window_cmd_edit_find_next) }, - { "EditToolbar", NULL, N_("Toolbar..."), NULL, - N_("Open Toolbar Editor Dialog"), + { "EditToolbar", NULL, N_("T_oolbar"), NULL, + N_("Customize the toolbar"), G_CALLBACK (ev_window_cmd_edit_toolbar) }, /* View menu */ @@ -2382,23 +2392,26 @@ static const GtkActionEntry entries[] = { G_CALLBACK (ev_window_cmd_leave_fullscreen) }, /* Accellerators */ - { "Escape", NULL, N_("Selection Caret"), "Escape", "", + { "Escape", NULL, "", "Escape", "", G_CALLBACK (ev_window_cmd_escape) }, { "Slash", GTK_STOCK_FIND, NULL, "slash", N_("Find a word or phrase in the document"), G_CALLBACK (ev_window_cmd_edit_find) }, - { "Space", GTK_STOCK_FIND, NULL, "space", + { "Space", NULL, "", "space", N_("Scroll one page forward"), G_CALLBACK (ev_window_cmd_scroll_forward) }, - { "ShiftSpace", GTK_STOCK_FIND, NULL, "<shift>space", + { "ShiftSpace", NULL, "", "<shift>space", N_("Scroll one page backward"), G_CALLBACK (ev_window_cmd_scroll_backward) }, - { "BackSpace", GTK_STOCK_FIND, NULL, "BackSpace", + { "BackSpace", NULL, "", "BackSpace", N_("Scroll one page backward"), G_CALLBACK (ev_window_cmd_scroll_backward) }, - { "ShiftBackSpace", GTK_STOCK_FIND, NULL, "<shift>BackSpace", + { "ShiftBackSpace", NULL, "", "<shift>BackSpace", N_("Scroll one page forward"), - G_CALLBACK (ev_window_cmd_scroll_forward) } + G_CALLBACK (ev_window_cmd_scroll_forward) }, + { "FocusPageSelector", NULL, "", "<control>l", + N_("Focus the page selector"), + G_CALLBACK (ev_window_cmd_focus_page_selector) } }; /* Toggle items */ |