diff --git a/ChangeLog b/ChangeLog index 143981006c..b6c629a90b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-03-19 Sven Neumann + + * app/display/gimpdisplayshell.c (gimp_display_shell_update_icon): + deal with NULL image and unset the icon. + + * app/display/gimpdisplay.c (gimp_display_set_image): unset the + icon when no image is set. + + * app/display/gimpdisplayshell-title.c + (gimp_display_shell_format_title): use GIMP_NAME as the window + title when no image is set. Append GIMP_ACRONYM otherwise. + 2008-03-18 Michael Natterer * app/display/gimpdisplayoptions.[ch]: add new options object diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index ce7cf62cf2..4043f3ba35 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -490,6 +490,8 @@ gimp_display_set_image (GimpDisplay *display, if (image) gimp_display_shell_reconnect (GIMP_DISPLAY_SHELL (display->shell)); + else + gimp_display_shell_update_icon (GIMP_DISPLAY_SHELL (display->shell)); } void diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c index ab92e3c370..0787b959ac 100644 --- a/app/display/gimpdisplayshell-title.c +++ b/app/display/gimpdisplayshell-title.c @@ -42,6 +42,8 @@ #include "gimpdisplayshell-title.h" #include "gimpstatusbar.h" +#include "about.h" + #include "gimp-intl.h" @@ -162,7 +164,7 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, if (! image) { - print (title, title_len, i, _("GIMP - Drop Files")); + print (title, title_len, i, GIMP_NAME); return; } @@ -423,5 +425,8 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, format++; } - title[MIN (i, title_len - 1)] = '\0'; + if (i) /* U+2013 EN DASH */ + i += g_strlcpy (title + i, " \342\200\223 ", title_len - i); + + g_strlcpy (title + i, GIMP_ACRONYM, title_len - i); } diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index f7f284ba78..258b99caed 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -1557,33 +1557,41 @@ void gimp_display_shell_update_icon (GimpDisplayShell *shell) { GimpImage *image; - GdkPixbuf *pixbuf; - gint width, height; - gdouble factor; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); image = shell->display->image; - factor = ((gdouble) gimp_image_get_height (image) / - (gdouble) gimp_image_get_width (image)); - - if (factor >= 1) + if (image) { - height = MAX (shell->icon_size, 1); - width = MAX (((gdouble) shell->icon_size) / factor, 1); + Gimp *gimp = shell->display->gimp; + GdkPixbuf *pixbuf; + gint width; + gint height; + gdouble factor = ((gdouble) gimp_image_get_height (image) / + (gdouble) gimp_image_get_width (image)); + + if (factor >= 1) + { + height = MAX (shell->icon_size, 1); + width = MAX (((gdouble) shell->icon_size) / factor, 1); + } + else + { + height = MAX (((gdouble) shell->icon_size) * factor, 1); + width = MAX (shell->icon_size, 1); + } + + pixbuf = gimp_viewable_get_pixbuf (GIMP_VIEWABLE (image), + gimp_get_user_context (gimp), + width, height); + + gtk_window_set_icon (GTK_WINDOW (shell), pixbuf); } else { - height = MAX (((gdouble) shell->icon_size) * factor, 1); - width = MAX (shell->icon_size, 1); + gtk_window_set_icon (GTK_WINDOW (shell), NULL); } - - pixbuf = gimp_viewable_get_pixbuf (GIMP_VIEWABLE (image), - gimp_get_user_context (shell->display->gimp), - width, height); - - gtk_window_set_icon (GTK_WINDOW (shell), pixbuf); } void