Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Ferretti <elle.uca@libero.it>2005-02-09 10:47:45 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-02-09 10:47:45 (GMT)
commitc65f029b1669d2aae4417169d6b0c25969521d47 (patch)
treecfa34bdcd53578b67888f412dd212b28c8c20958
parent9fc99e3207e7917a5c09fef1a961f8cdf45ce7ed (diff)
Improve toolbar layout/icons
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
-rw-r--r--ChangeLog12
-rw-r--r--data/Makefile.am6
-rw-r--r--data/evince-ui.xml8
-rw-r--r--shell/ev-stock-icons.c59
-rw-r--r--shell/ev-stock-icons.h7
-rw-r--r--shell/ev-window.c68
6 files changed, 82 insertions, 78 deletions
diff --git a/ChangeLog b/ChangeLog
index 421e5c8..6fc1f34 100644
--- 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:
diff --git a/data/Makefile.am b/data/Makefile.am
index 60f14f9..0b1bd18 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -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) \
diff --git a/data/evince-ui.xml b/data/evince-ui.xml
index 88d18a2..bce68ea 100644
--- a/data/evince-ui.xml
+++ b/data/evince-ui.xml
@@ -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/>
diff --git a/shell/ev-stock-icons.c b/shell/ev-stock-icons.c
index a9f533c..f60697d 100644
--- a/shell/ev-stock-icons.c
+++ b/shell/ev-stock-icons.c
@@ -29,51 +29,44 @@
#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));
}
diff --git a/shell/ev-stock-icons.h b/shell/ev-stock-icons.h
index 52c54cf..55616dd 100644
--- a/shell/ev-stock-icons.h
+++ b/shell/ev-stock-icons.h
@@ -28,9 +28,10 @@
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);
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 84206b7..4f7bab4 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -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);