]> www.fi.muni.cz Git - evince.git/commitdiff
Improve toolbar layout/icons
authorLuca Ferretti <elle.uca@libero.it>
Wed, 9 Feb 2005 10:47:45 +0000 (10:47 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Wed, 9 Feb 2005 10:47:45 +0000 (10:47 +0000)
2005-02-09  Luca Ferretti <elle.uca@libero.it>

        * data/Makefile.am:
        * data/evince-ui.xml:
        * shell/ev-stock-icons.c: (ev_stock_icons_init):
        * shell/ev-stock-icons.h:
        * shell/ev-window.c: (update_action_sensitivity),
        (ev_window_cmd_go_previous_page), (ev_window_cmd_go_next_page),
        (set_action_properties):

        Improve toolbar layout/icons

ChangeLog
data/Makefile.am
data/evince-ui.xml
shell/ev-stock-icons.c
shell/ev-stock-icons.h
shell/ev-window.c

index 421e5c8e1671ac3db3443a448f0961fdc0005f0b..6fc1f34693036b4a3ee38a4bd9f43575a1a039fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-02-09  Luca Ferretti <elle.uca@libero.it>
+
+       * data/Makefile.am:
+       * data/evince-ui.xml:
+       * shell/ev-stock-icons.c: (ev_stock_icons_init):
+       * shell/ev-stock-icons.h:
+       * shell/ev-window.c: (update_action_sensitivity),
+       (ev_window_cmd_go_previous_page), (ev_window_cmd_go_next_page),
+       (set_action_properties):
+
+       Improve toolbar layout/icons
+
 2005-02-08  Marco Pesenti Gritti  <marco@gnome.org>
 
        * pdf/xpdf/pdf-document.cc:
index 60f14f9c6f68c239c70a639b2a2160e73f6dd228..0b1bd18fe34851bb8c868c271bb70a47822e4e94 100644 (file)
@@ -13,11 +13,6 @@ glade_DATA =                                 \
        evince-password.glade           \
        $(NULL)
 
-stockdir = $(datadir)/pixmaps/evince
-stock_DATA =                           \
-        ev-stock-zoom-fit-width.png    \
-       $(NULL)
-
 DESKTOP_IN_FILES= evince.desktop.in
 DESKTOP_FILES= $(DESKTOP_IN_FILES:.desktop.in=.desktop)
 
@@ -38,7 +33,6 @@ if GCONF_SCHEMAS_INSTALL
 endif
 
 EXTRA_DIST =                           \
-       $(stock_DATA)                   \
        $(glade_DATA)                   \
        $(ui_DATA)                      \
        $(DESKTOP_IN_FILES)             \
index 88d18a2e91869dfd2e40fd24fd42f599c51357e6..bce68ea259c1026f400176300abe3429ad8a493a 100644 (file)
@@ -33,8 +33,8 @@
     </menu>
 
     <menu name="GoMenu" action="Go">
-      <menuitem name="GoPageUpMenu" action="GoPageUp"/>
-      <menuitem name="GoPageDownMenu" action="GoPageDown"/>
+      <menuitem name="GoPreviousPageMenu" action="GoPreviousPage"/>
+      <menuitem name="GoNextPageMenu" action="GoNextPage"/>
       <separator/>
       <menuitem name="GoFirstPageMenu" action="GoFirstPage"/>
       <menuitem name="GoLastPageMenu" action="GoLastPage"/>
@@ -47,8 +47,8 @@
   </menubar>
 
   <toolbar name="ToolBar">
-    <toolitem action="GoPageDown"/>
-    <toolitem action="GoPageUp"/>
+    <toolitem action="GoPreviousPage"/>
+    <toolitem action="GoNextPage"/>
     <separator/>
     <toolitem action="PageSelector"/>
     <separator/>
index a9f533caeeb30c377541a5f844a8a2de4bf09223..f60697d1061fe293d75f9d4ae50613bfec74685b 100644 (file)
 #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));
 }
index 52c54cf381d52d153e38bc0f04d57a4060e39c05..55616dd0d5ba3304d6f2c67fe2ba1ddfbb209557 100644 (file)
 
 G_BEGIN_DECLS
 
-/* Toolbar icons */
-#define EV_STOCK_ZOOM_FIT_WIDTH "ev-zoom-fit-width"
-#define EV_STOCK_LEAVE_FULLSCREEN "stock_leave-fullscreen"
+/* Evince stock icons */
+#define EV_STOCK_ZOOM_PAGE              "stock_zoom-page" 
+#define EV_STOCK_ZOOM_WIDTH             "stock_zoom-page-width" 
+#define EV_STOCK_LEAVE_FULLSCREEN       "stock_leave-fullscreen"
 
 void ev_stock_icons_init (void);
 
index 84206b7a4c99742e01bfb0d4a3f2efbdfb58d39d..4f7bab4a76f6e4142930ca002a9d004492573faa 100644 (file)
@@ -178,14 +178,14 @@ update_action_sensitivity (EvWindow *ev_window)
                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);
        }
 
@@ -1144,7 +1144,7 @@ ev_window_cmd_view_page_width (GtkAction *action, EvWindow *ev_window)
 }
 
 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));
 
@@ -1153,7 +1153,7 @@ ev_window_cmd_go_page_up (GtkAction *action, EvWindow *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));
 
@@ -1521,54 +1521,54 @@ static GtkActionEntry entries[] = {
        { "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) },
@@ -1595,13 +1595,13 @@ static GtkActionEntry entries[] = {
 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"),
@@ -1648,12 +1648,16 @@ set_action_properties (GtkActionGroup *action_group)
 {
        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);