#include <gtk/gtkstock.h>
#include <gdk/gdkpixbuf.h>
-/* Toolbar icons files */
-#define STOCK_ZOOM_FIT_WIDTH_FILE "ev-stock-zoom-fit-width.png"
+typedef struct {
+ char *stock_id;
+ char *icon;
+} EvStockIcon;
+
+/* Evince stock icons from gnome-icon-theme */
+static EvStockIcon stock_icons [] = {
+ { EV_STOCK_ZOOM_PAGE, "stock_zoom-page" },
+ { EV_STOCK_ZOOM_WIDTH, "stock_zoom-page-width" },
+ { EV_STOCK_LEAVE_FULLSCREEN, "stock_leave-fullscreen" }
+};
-#define EV_ADD_STOCK_ICON(id, file, def_id) \
-{ \
- GdkPixbuf *pixbuf; \
- GtkIconSet *icon_set = NULL; \
- pixbuf = gdk_pixbuf_new_from_file (GNOMEICONDIR "/evince/" file, NULL); \
- if (pixbuf) { \
- icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); \
- } else if (def_id) { \
- icon_set = gtk_icon_factory_lookup_default (def_id); \
- gtk_icon_set_ref (icon_set); \
- } \
- gtk_icon_factory_add (factory, id, icon_set); \
- gtk_icon_set_unref (icon_set); \
-}
void
ev_stock_icons_init (void)
{
- static const char *icon_theme_items[] = {
- EV_STOCK_LEAVE_FULLSCREEN
- };
- GtkIconFactory *factory;
- guint i;
+ GtkIconFactory *factory;
+ GtkIconSource *source;
+ gint i;
factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (factory);
- /* fitwidth stock icon */
- EV_ADD_STOCK_ICON (EV_STOCK_ZOOM_FIT_WIDTH, STOCK_ZOOM_FIT_WIDTH_FILE, GTK_STOCK_ZOOM_FIT);
+ source = gtk_icon_source_new ();
+
+ for (i = 0; i < G_N_ELEMENTS (stock_icons); i++) {
+ GtkIconSet *set;
- for (i = 0; i < G_N_ELEMENTS (icon_theme_items); i++) {
- GtkIconSet *icon_set;
- GtkIconSource *icon_source;
+ gtk_icon_source_set_icon_name (source, stock_icons [i].icon);
- icon_set = gtk_icon_set_new ();
- icon_source = gtk_icon_source_new ();
- gtk_icon_source_set_icon_name (icon_source, icon_theme_items[i]);
- gtk_icon_set_add_source (icon_set, icon_source);
- gtk_icon_factory_add (factory, icon_theme_items[i], icon_set);
- gtk_icon_set_unref (icon_set);
- gtk_icon_source_free (icon_source);
+ set = gtk_icon_set_new ();
+ gtk_icon_set_add_source (set, source);
+
+ gtk_icon_factory_add (factory, stock_icons [i].stock_id, set);
+ gtk_icon_set_unref (set);
}
+ gtk_icon_source_free (source);
+
g_object_unref (G_OBJECT (factory));
}
page = ev_view_get_page (EV_VIEW (ev_window->priv->view));
n_pages = ev_document_get_n_pages (document);
- set_action_sensitive (ev_window, "GoPageUp", page > 1);
- set_action_sensitive (ev_window, "GoPageDown", page < n_pages);
+ set_action_sensitive (ev_window, "GoPreviousPage", page > 1);
+ set_action_sensitive (ev_window, "GoNextPage", page < n_pages);
set_action_sensitive (ev_window, "GoFirstPage", page > 1);
set_action_sensitive (ev_window, "GoLastPage", page < n_pages);
} else {
set_action_sensitive (ev_window, "GoFirstPage", FALSE);
- set_action_sensitive (ev_window, "GoPageUp", FALSE);
- set_action_sensitive (ev_window, "GoPageDown", FALSE);
+ set_action_sensitive (ev_window, "GoPreviousPage", FALSE);
+ set_action_sensitive (ev_window, "GoNextPage", FALSE);
set_action_sensitive (ev_window, "GoLastPage", FALSE);
}
}
static void
-ev_window_cmd_go_page_up (GtkAction *action, EvWindow *ev_window)
+ev_window_cmd_go_previous_page (GtkAction *action, EvWindow *ev_window)
{
g_return_if_fail (EV_IS_WINDOW (ev_window));
}
static void
-ev_window_cmd_go_page_down (GtkAction *action, EvWindow *ev_window)
+ev_window_cmd_go_next_page (GtkAction *action, EvWindow *ev_window)
{
g_return_if_fail (EV_IS_WINDOW (ev_window));
{ "Help", NULL, N_("_Help") },
/* File menu */
- { "FileOpen", GTK_STOCK_OPEN, N_("_Open"), "<control>O",
- N_("Open a file"),
+ { "FileOpen", GTK_STOCK_OPEN, NULL, "<control>O",
+ N_("Open an existing document"),
G_CALLBACK (ev_window_cmd_file_open) },
{ "FileSaveAs", GTK_STOCK_SAVE_AS, N_("_Save a Copy..."), NULL,
N_("Save the current document with a new filename"),
G_CALLBACK (ev_window_cmd_save_as) },
- { "FilePrint", GTK_STOCK_PRINT, N_("_Print"), "<control>P",
+ { "FilePrint", GTK_STOCK_PRINT, NULL, "<control>P",
N_("Print this document"),
G_CALLBACK (ev_window_cmd_file_print) },
- { "FileCloseWindow", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",
+ { "FileCloseWindow", GTK_STOCK_CLOSE, NULL, "<control>W",
N_("Close this window"),
G_CALLBACK (ev_window_cmd_file_close_window) },
/* Edit menu */
- { "EditCopy", GTK_STOCK_COPY, N_("_Copy"), "<control>C",
+ { "EditCopy", GTK_STOCK_COPY, NULL, "<control>C",
N_("Copy text from the document"),
G_CALLBACK (ev_window_cmd_edit_copy) },
{ "EditSelectAll", NULL, N_("Select _All"), "<control>A",
N_("Select the entire page"),
G_CALLBACK (ev_window_cmd_edit_select_all) },
- { "EditFind", GTK_STOCK_FIND, N_("_Find"), "<control>F",
+ { "EditFind", GTK_STOCK_FIND, NULL, "<control>F",
N_("Find a word or phrase in the document"),
G_CALLBACK (ev_window_cmd_edit_find) },
/* View menu */
- { "ViewZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "<control>plus",
+ { "ViewZoomIn", GTK_STOCK_ZOOM_IN, NULL, "<control>plus",
N_("Enlarge the document"),
G_CALLBACK (ev_window_cmd_view_zoom_in) },
- { "ViewZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "<control>minus",
+ { "ViewZoomOut", GTK_STOCK_ZOOM_OUT, NULL, "<control>minus",
N_("Shrink the document"),
G_CALLBACK (ev_window_cmd_view_zoom_out) },
- { "ViewNormalSize", GTK_STOCK_ZOOM_100, N_("_Normal Size"), "<control>0",
- N_("Zoom to the normal size"),
+ { "ViewNormalSize", GTK_STOCK_ZOOM_100, NULL, "<control>0",
+ N_("Reset the zoom level to the defaul value"),
G_CALLBACK (ev_window_cmd_view_normal_size) },
- { "ViewBestFit", GTK_STOCK_ZOOM_FIT, N_("_Best Fit"), NULL,
- N_("Zoom to fit the document to the current window"),
+ { "ViewBestFit", EV_STOCK_ZOOM_PAGE, N_("_Best Fit"), NULL,
+ N_("Make the current document fill the window"),
G_CALLBACK (ev_window_cmd_view_best_fit) },
- { "ViewPageWidth", EV_STOCK_ZOOM_FIT_WIDTH, N_("Fit Page _Width"), NULL,
- N_("Zoom to fit the width of the current window "),
+ { "ViewPageWidth", EV_STOCK_ZOOM_WIDTH, N_("Fit Page _Width"), NULL,
+ N_("Make the current document fill the window width"),
G_CALLBACK (ev_window_cmd_view_page_width) },
/* Go menu */
- { "GoPageUp", GTK_STOCK_GO_UP, N_("_Page Up"), "<control>Page_Up",
+ { "GoPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "Page_Up",
N_("Go to the previous page"),
- G_CALLBACK (ev_window_cmd_go_page_up) },
- { "GoPageDown", GTK_STOCK_GO_DOWN, N_("_Page Down"), "<control>Page_Down",
+ G_CALLBACK (ev_window_cmd_go_previous_page) },
+ { "GoNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "Page_Down",
N_("Go to the next page"),
- G_CALLBACK (ev_window_cmd_go_page_down) },
+ G_CALLBACK (ev_window_cmd_go_next_page) },
{ "GoFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "<control>Home",
N_("Go to the first page"),
G_CALLBACK (ev_window_cmd_go_first_page) },
static GtkToggleActionEntry toggle_entries[] = {
/* View Menu */
{ "ViewToolbar", NULL, N_("_Toolbar"), "<shift><control>T",
- N_("Show or hide toolbar"),
+ N_("Show or hide the toolbar"),
G_CALLBACK (ev_window_view_toolbar_cb), TRUE },
{ "ViewStatusbar", NULL, N_("_Statusbar"), NULL,
- N_("Show or hide statusbar"),
+ N_("Show or hide the statusbar"),
G_CALLBACK (ev_window_view_statusbar_cb), TRUE },
- { "ViewSidebar", NULL, N_("Side_bar"), "F9",
- N_("Show or hide sidebar"),
+ { "ViewSidebar", NULL, N_("Side _pane"), "F9",
+ N_("Show or hide the side pane"),
G_CALLBACK (ev_window_view_sidebar_cb), TRUE },
{ "ViewFullscreen", NULL, N_("_Fullscreen"), "F11",
N_("Expand the window to fill the screen"),
{
GtkAction *action;
- action = gtk_action_group_get_action (action_group, "GoPageUp");
- g_object_set (action, "short_label", _("Up"), NULL);
- action = gtk_action_group_get_action (action_group, "GoPageDown");
- g_object_set (action, "short_label", _("Down"), NULL);
+ action = gtk_action_group_get_action (action_group, "GoPreviousPage");
+ /*translators: this is the label for toolbar button*/
+ g_object_set (action, "short_label", _("Previous"), NULL);
+ action = gtk_action_group_get_action (action_group, "GoNextPage");
+ /*translators: this is the label for toolbar button*/
+ g_object_set (action, "short_label", _("Next"), NULL);
action = gtk_action_group_get_action (action_group, "ViewPageWidth");
+ /*translators: this is the label for toolbar button*/
g_object_set (action, "short_label", _("Fit Width"), NULL);
+ action = gtk_action_group_get_action (action_group, "ViewZoomIn");
action = gtk_action_group_get_action (action_group, "LeaveFullscreen");
g_object_set (action, "is-important", TRUE, NULL);