From 122c227b07387a942e4379eef8132fe6b6e92e80 Mon Sep 17 00:00:00 2001 From: Nickolay V. Shmyrev Date: Wed, 09 May 2007 16:26:44 +0000 Subject: Add app-specific icons to our icon theme. Fixes bug #425508. 2007-05-09 Nickolay V. Shmyrev * shell/ev-application.c: (ev_application_open_window), (ev_application_add_icon_path_for_screen), (ev_application_open_uri_at_dest): * shell/ev-navigation-action-widget.c: (popup_menu_under_arrow): * shell/ev-navigation-action.c: (build_menu): Add app-specific icons to our icon theme. Fixes bug #425508. svn path=/trunk/; revision=2444 --- diff --git a/ChangeLog b/ChangeLog index de28131..6113681 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,24 @@ 2007-05-09 Nickolay V. Shmyrev + * shell/ev-application.c: (ev_application_open_window), + (ev_application_add_icon_path_for_screen), + (ev_application_open_uri_at_dest): + * shell/ev-navigation-action-widget.c: (popup_menu_under_arrow): + * shell/ev-navigation-action.c: (build_menu): + + Add app-specific icons to our icon theme. Fixes bug + #425508. + +2007-05-09 Nickolay V. Shmyrev + + * shell/ev-application.c: (ev_application_open_window), + (ev_application_add_icon_path_for_screen), + (ev_application_open_uri_at_dest): + * shell/ev-navigation-action-widget.c: (popup_menu_under_arrow): + * shell/ev-navigation-action.c: (build_menu): + +2007-05-09 Nickolay V. Shmyrev + * shell/ev-history.c: (ev_history_class_init), (ev_history_add_link): * shell/ev-history.h: diff --git a/shell/ev-application.c b/shell/ev-application.c index 1d21c2c..ce67ebb 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -45,6 +45,8 @@ #include +static void ev_application_add_icon_path_for_screen (GdkScreen *screen); + struct _EvApplication { GObject base_instance; @@ -379,6 +381,7 @@ ev_application_open_window (EvApplication *application, if (screen) { gtk_window_set_screen (GTK_WINDOW (new_window), screen); } + ev_application_add_icon_path_for_screen (screen); gtk_widget_show (new_window); @@ -458,30 +461,11 @@ ev_application_get_uri_window (EvApplication *application, const char *uri) return uri_window; } -/** - * ev_application_open_uri_at_dest: - * @application: The instance of the application. - * @uri: The uri to be opened. - * @screen: Thee screen where the link will be shown. - * @dest: The #EvLinkDest of the document. - * @mode: The run mode of the window. - * @unlink_temp_file: The unlink_temp_file option value. - * @timestamp: Current time value. - */ -void -ev_application_open_uri_at_dest (EvApplication *application, - const char *uri, - GdkScreen *screen, - EvLinkDest *dest, - EvWindowRunMode mode, - gboolean unlink_temp_file, - guint timestamp) +static void +ev_application_add_icon_path_for_screen (GdkScreen *screen) { - EvWindow *new_window; GtkIconTheme *icon_theme; - g_return_if_fail (uri != NULL); - icon_theme = gtk_icon_theme_get_for_screen (screen); if (icon_theme) { gchar **path = NULL; @@ -506,6 +490,32 @@ ev_application_open_uri_at_dest (EvApplication *application, g_free (ev_icons_path); g_strfreev (path); } +} + +/** + * ev_application_open_uri_at_dest: + * @application: The instance of the application. + * @uri: The uri to be opened. + * @screen: Thee screen where the link will be shown. + * @dest: The #EvLinkDest of the document. + * @mode: The run mode of the window. + * @unlink_temp_file: The unlink_temp_file option value. + * @timestamp: Current time value. + */ +void +ev_application_open_uri_at_dest (EvApplication *application, + const char *uri, + GdkScreen *screen, + EvLinkDest *dest, + EvWindowRunMode mode, + gboolean unlink_temp_file, + guint timestamp) +{ + EvWindow *new_window; + + g_return_if_fail (uri != NULL); + + ev_application_add_icon_path_for_screen (screen); new_window = ev_application_get_uri_window (application, uri); diff --git a/shell/ev-navigation-action-widget.c b/shell/ev-navigation-action-widget.c index 1de4cf1..fafa501 100644 --- a/shell/ev-navigation-action-widget.c +++ b/shell/ev-navigation-action-widget.c @@ -157,11 +157,11 @@ static void popup_menu_under_arrow (EvNavigationActionWidget *button, GdkEventButton *event) { + g_signal_emit (button, signals[SHOW_MENU], 0); + if (!button->menu) return; - g_signal_emit (button, signals[SHOW_MENU], 0); - gtk_menu_popup (button->menu, NULL, NULL, (GtkMenuPositionFunc) menu_position_func, button, diff --git a/shell/ev-navigation-action.c b/shell/ev-navigation-action.c index 9da89f9..3aa1bea 100644 --- a/shell/ev-navigation-action.c +++ b/shell/ev-navigation-action.c @@ -134,12 +134,12 @@ build_menu (EvNavigationAction *action) EvHistory *history = action->priv->history; int start, end, i; - menu = GTK_MENU_SHELL (gtk_menu_new ()); - - if (history == NULL) { - return GTK_WIDGET (menu); + if (history == NULL || ev_history_get_n_links (history) <= 0) { + return NULL; } + menu = GTK_MENU_SHELL (gtk_menu_new ()); + start = 0; end = ev_history_get_n_links (history); -- cgit v0.9.1