diff --git a/ChangeLog b/ChangeLog index 8fb2f04de7..55c32a0a8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,35 @@ +2002-01-09 Sven Neumann + + * themes/Default/images/Makefile.am + * themes/Default/images/gimp-dialog-error.png + * themes/Default/images/gimp-dialog-info.png + * themes/Default/images/gimp-dialog-question.png + * themes/Default/images/gimp-dialog-warning.png: new stock icons to + override the standard gtk-dialog icons. + + * themes/Default/images/gimp-dialog-icons.xcf.gz: XCF version of the + new dialog icons. + + * themes/Default/gtkrc: override the standard gtk-dialog icons with + our versions. + + * libgimpwidgets/gimpquerybox.[ch]: allow to pass a stock_id instead + of the boolean eek. + + * app/widgets/gimpwidgets-utils.c: added an icon to the gimp_message + dialog. We need to add an API to declare the severity of the message + or allow to pass a stock_id. For now all messages habe the Info icon. + + * app/gui/file-commands.c + * app/gui/file-new-dialog.c + * app/gui/file-save-dialog.c + * app/gui/gui.c + * app/gui/image-commands.c + * plug-ins/FractalExplorer/FractalExplorer.c + * plug-ins/gfig/gfig.c + * plug-ins/gflare/gflare.c: pass a suitable(?) stock_id to + gimp_query_boolean_box(). + 2002-01-08 Michael Natterer * plug-ins/common/tga.c diff --git a/app/actions/file-commands.c b/app/actions/file-commands.c index 0d0e383d81..ff17e200b5 100644 --- a/app/actions/file-commands.c +++ b/app/actions/file-commands.c @@ -252,7 +252,7 @@ file_revert_cmd_callback (GtkWidget *widget, query_box = gimp_query_boolean_box (_("Revert Image"), gimp_standard_help_func, "file/revert.html", - FALSE, + GTK_STOCK_DIALOG_QUESTION, text, GTK_STOCK_YES, GTK_STOCK_NO, G_OBJECT (gdisp->gimage), diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c index c5bd96e576..9c5456a73b 100644 --- a/app/actions/image-commands.c +++ b/app/actions/image-commands.c @@ -259,7 +259,7 @@ image_scale_callback (GtkWidget *widget, gimp_query_boolean_box (_("Layer Too Small"), gimp_standard_help_func, "dialogs/scale_layer_warn.html", - FALSE, + GTK_STOCK_DIALOG_QUESTION, _("The chosen image size will shrink\n" "some layers completely away.\n" "Is this what you want?"), diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c index 1e944ff2d9..8612d7c81b 100644 --- a/app/dialogs/file-save-dialog.c +++ b/app/dialogs/file-save-dialog.c @@ -425,7 +425,7 @@ file_overwrite (const gchar *filename, query_box = gimp_query_boolean_box (_("File Exists!"), gimp_standard_help_func, "save/file_exists.html", - FALSE, + GTK_STOCK_DIALOG_QUESTION, overwrite_text, GTK_STOCK_YES, GTK_STOCK_NO, NULL, NULL, diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c index 65017d94a1..ff62cff173 100644 --- a/app/dialogs/image-new-dialog.c +++ b/app/dialogs/image-new-dialog.c @@ -594,7 +594,7 @@ file_new_confirm_dialog (NewImageInfo *info) gimp_query_boolean_box (_("Confirm Image Size"), gimp_standard_help_func, "dialogs/file_new.html#confirm_size", - FALSE, + GTK_STOCK_DIALOG_INFO, text, GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL, NULL, diff --git a/app/gui/file-commands.c b/app/gui/file-commands.c index 0d0e383d81..ff17e200b5 100644 --- a/app/gui/file-commands.c +++ b/app/gui/file-commands.c @@ -252,7 +252,7 @@ file_revert_cmd_callback (GtkWidget *widget, query_box = gimp_query_boolean_box (_("Revert Image"), gimp_standard_help_func, "file/revert.html", - FALSE, + GTK_STOCK_DIALOG_QUESTION, text, GTK_STOCK_YES, GTK_STOCK_NO, G_OBJECT (gdisp->gimage), diff --git a/app/gui/file-new-dialog.c b/app/gui/file-new-dialog.c index 65017d94a1..ff62cff173 100644 --- a/app/gui/file-new-dialog.c +++ b/app/gui/file-new-dialog.c @@ -594,7 +594,7 @@ file_new_confirm_dialog (NewImageInfo *info) gimp_query_boolean_box (_("Confirm Image Size"), gimp_standard_help_func, "dialogs/file_new.html#confirm_size", - FALSE, + GTK_STOCK_DIALOG_INFO, text, GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL, NULL, diff --git a/app/gui/file-save-dialog.c b/app/gui/file-save-dialog.c index 1e944ff2d9..8612d7c81b 100644 --- a/app/gui/file-save-dialog.c +++ b/app/gui/file-save-dialog.c @@ -425,7 +425,7 @@ file_overwrite (const gchar *filename, query_box = gimp_query_boolean_box (_("File Exists!"), gimp_standard_help_func, "save/file_exists.html", - FALSE, + GTK_STOCK_DIALOG_QUESTION, overwrite_text, GTK_STOCK_YES, GTK_STOCK_NO, NULL, NULL, diff --git a/app/gui/gui.c b/app/gui/gui.c index d06cea73fb..52bfb9042b 100644 --- a/app/gui/gui.c +++ b/app/gui/gui.c @@ -378,7 +378,7 @@ gui_really_quit_dialog (GCallback quit_func) dialog = gimp_query_boolean_box (_("Quit The GIMP?"), gimp_standard_help_func, "dialogs/really_quit.html", - TRUE, + GTK_STOCK_DIALOG_WARNING, _("Some files are unsaved.\n" "\nReally quit The GIMP?"), GTK_STOCK_QUIT, GTK_STOCK_CANCEL, diff --git a/app/gui/image-commands.c b/app/gui/image-commands.c index c5bd96e576..9c5456a73b 100644 --- a/app/gui/image-commands.c +++ b/app/gui/image-commands.c @@ -259,7 +259,7 @@ image_scale_callback (GtkWidget *widget, gimp_query_boolean_box (_("Layer Too Small"), gimp_standard_help_func, "dialogs/scale_layer_warn.html", - FALSE, + GTK_STOCK_DIALOG_QUESTION, _("The chosen image size will shrink\n" "some layers completely away.\n" "Is this what you want?"), diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c index 2becfb4a9e..920562b808 100644 --- a/app/widgets/gimpwidgets-utils.c +++ b/app/widgets/gimpwidgets-utils.c @@ -65,11 +65,13 @@ gimp_message_box (const gchar *message, GtkCallback callback, gpointer data) { - MessageBox *msg_box; - GtkWidget *mbox; - GtkWidget *vbox; - GtkWidget *label; - GList *list; + MessageBox *msg_box; + GtkWidget *mbox; + GtkWidget *hbox; + GtkWidget *image; + GtkWidget *label; + GList *list; + const gchar *stock_id = GTK_STOCK_DIALOG_INFO; if (!message) return; @@ -118,6 +120,7 @@ gimp_message_box (const gchar *message, message = _("WARNING:\n" "Too many open message dialogs.\n" "Messages are redirected to stderr."); + stock_id = GTK_STOCK_DIALOG_WARNING; } msg_box = g_new0 (MessageBox, 1); @@ -132,14 +135,17 @@ gimp_message_box (const gchar *message, NULL); - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (mbox)->vbox), vbox); - gtk_widget_show (vbox); + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (mbox)->vbox), hbox); + gtk_widget_show (hbox); + + image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_DIALOG); + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); + gtk_widget_show (image); label = gtk_label_new (message); - gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); - gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); msg_box->mbox = mbox; diff --git a/libgimpwidgets/gimpquerybox.c b/libgimpwidgets/gimpquerybox.c index 9e6a53f488..68fc80f029 100644 --- a/libgimpwidgets/gimpquerybox.c +++ b/libgimpwidgets/gimpquerybox.c @@ -36,8 +36,6 @@ #include "libgimp/libgimp-intl.h" -#include "pixmaps/eek.xpm" - /* * String, integer, double and size query boxes @@ -415,8 +413,8 @@ gimp_query_size_box (const gchar *title, * @title: The query box dialog's title. * @help_func: The help function to show this dialog's help page. * @help_data: A string pointing to this dialog's html help page. - * @eek: #TRUE if you want the "Eek" wilber to appear left of - * the dialog's message. + * @stock_id: A stock_id to specify an icon to appear on the left + * on the dialog's message. * @message: A string which will be shown in the query box. * @true_button: The string to be shown in the dialog's left button. * @false_button: The string to be shown in the dialog's right button. @@ -433,7 +431,7 @@ GtkWidget * gimp_query_boolean_box (const gchar *title, GimpHelpFunc help_func, const gchar *help_data, - gboolean eek, + const gchar *stock_id, const gchar *message, const gchar *true_button, const gchar *false_button, @@ -444,13 +442,16 @@ gimp_query_boolean_box (const gchar *title, { QueryBox *query_box; GtkWidget *hbox; - GtkWidget *pixmap; + GtkWidget *image = NULL; GtkWidget *label; + if (stock_id) + image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_DIALOG); + query_box = create_query_box (title, help_func, help_data, G_CALLBACK (boolean_query_box_true_callback), G_CALLBACK (boolean_query_box_false_callback), - eek ? NULL : message, + image ? NULL : message, true_button, false_button, object, signal, G_CALLBACK (callback), data); @@ -458,7 +459,7 @@ gimp_query_boolean_box (const gchar *title, if (! query_box) return NULL; - if (! eek) + if (! image) return query_box->qbox; hbox = gtk_hbox_new (FALSE, 10); @@ -466,9 +467,8 @@ gimp_query_boolean_box (const gchar *title, gtk_container_add (GTK_CONTAINER (GTK_DIALOG (query_box->qbox)->vbox), hbox); gtk_widget_show (hbox); - pixmap = gimp_pixmap_new (eek_xpm); - gtk_box_pack_start (GTK_BOX (hbox), pixmap, FALSE, FALSE, 0); - gtk_widget_show (pixmap); + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); + gtk_widget_show (image); label = gtk_label_new (message); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); diff --git a/libgimpwidgets/gimpquerybox.h b/libgimpwidgets/gimpquerybox.h index 72873dd219..eeab8130e9 100644 --- a/libgimpwidgets/gimpquerybox.h +++ b/libgimpwidgets/gimpquerybox.h @@ -105,7 +105,7 @@ GtkWidget * gimp_query_size_box (const gchar *title, GtkWidget * gimp_query_boolean_box (const gchar *title, GimpHelpFunc help_func, const gchar *help_data, - gboolean eek, + const gchar *stock_id, const gchar *message, const gchar *true_button, const gchar *false_button, diff --git a/plug-ins/FractalExplorer/FractalExplorer.c b/plug-ins/FractalExplorer/FractalExplorer.c index efbc58525d..829e3c9ef8 100644 --- a/plug-ins/FractalExplorer/FractalExplorer.c +++ b/plug-ins/FractalExplorer/FractalExplorer.c @@ -742,7 +742,7 @@ delete_fractal_callback (GtkWidget *widget, delete_dialog = gimp_query_boolean_box (_("Delete Fractal"), gimp_standard_help_func, "filters/fractalexplorer.html", - FALSE, + GTK_STOCK_DIALOG_QUESTION, str, GTK_STOCK_DELETE, GTK_STOCK_CANCEL, G_OBJECT (widget), "destroy", diff --git a/plug-ins/gfig/gfig.c b/plug-ins/gfig/gfig.c index 06efeec04b..bcd736408d 100644 --- a/plug-ins/gfig/gfig.c +++ b/plug-ins/gfig/gfig.c @@ -4089,7 +4089,7 @@ gfig_ok_callback (GtkWidget *widget, dialog = gimp_query_boolean_box (_("Warning"), gimp_standard_help_func, "filters/gfig.html", - FALSE, + GTK_STOCK_DIALOG_WARNING, message, GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL, NULL, diff --git a/plug-ins/gflare/gflare.c b/plug-ins/gflare/gflare.c index 9c94a93489..d938502a9e 100644 --- a/plug-ins/gflare/gflare.c +++ b/plug-ins/gflare/gflare.c @@ -3450,7 +3450,7 @@ dlg_selector_delete_callback (GtkWidget *widget, dialog = gimp_query_boolean_box (_("Delete GFlare"), gimp_standard_help_func, "filters/gflare.html", - FALSE, + GTK_STOCK_DIALOG_QUESTION, str, GTK_STOCK_DELETE, GTK_STOCK_CANCEL, NULL, NULL, diff --git a/themes/Default/gtkrc b/themes/Default/gtkrc index 89a4d84a75..aacc13f2e1 100644 --- a/themes/Default/gtkrc +++ b/themes/Default/gtkrc @@ -15,6 +15,30 @@ # # include "imagerc" +# Do override some GTK stock icons however. + +style "gimp-dialog-icons" +{ + stock["gtk-dialog-error"] = + { + { "images/gimp-dialog-error.png", *, *, "gtk-dialog" } + } + stock["gtk-dialog-info"] = + { + { "images/gimp-dialog-info.png", *, *, "gtk-dialog" } + } + stock["gtk-dialog-question"] = + { + { "images/gimp-dialog-question.png", *, *, "gtk-dialog" } + } + stock["gtk-dialog-warning"] = + { + { "images/gimp-dialog-warning.png", *, *, "gtk-dialog" } + } +} + +class "GtkImage" style "gimp-dialog-icons" + style "gimp-normal-font-style" { diff --git a/themes/Default/images/Makefile.am b/themes/Default/images/Makefile.am index 58fa75582f..df496ce28e 100644 --- a/themes/Default/images/Makefile.am +++ b/themes/Default/images/Makefile.am @@ -4,6 +4,13 @@ SUBDIRS = tools themedatadir = $(gimpdatadir)/themes/Default/images +DIALOG_IMAGES = @STRIP_BEGIN@ \ + gimp-dialog-error.png \ + gimp-dialog-info.png \ + gimp-dialog-question.png \ + gimp-dialog-warning.png \ +@STRIP_END@ + STOCK_IMAGES = @STRIP_BEGIN@ \ stock-button-anchor.png \ stock-button-delete.png \ @@ -41,6 +48,10 @@ WILBER_IMAGES = @STRIP_BEGIN@ \ stock-wilber-64x64.png \ @STRIP_END@ -themedata_DATA = $(STOCK_IMAGES) +themedata_DATA = $(DIALOG_IMAGES) -EXTRA_DIST = $(themedata_DATA) $(WILBER_IMAGES) +EXTRA_DIST = \ + $(themedata_DATA) \ + $(STOCK_IMAGES) \ + $(WILBER_IMAGES) \ + gimp-dialog-icons.xcf.gz diff --git a/themes/Default/images/gimp-dialog-error.png b/themes/Default/images/gimp-dialog-error.png new file mode 100644 index 0000000000..43f1acb468 Binary files /dev/null and b/themes/Default/images/gimp-dialog-error.png differ diff --git a/themes/Default/images/gimp-dialog-icons.xcf.gz b/themes/Default/images/gimp-dialog-icons.xcf.gz new file mode 100644 index 0000000000..64b54f60d8 Binary files /dev/null and b/themes/Default/images/gimp-dialog-icons.xcf.gz differ diff --git a/themes/Default/images/gimp-dialog-info.png b/themes/Default/images/gimp-dialog-info.png new file mode 100644 index 0000000000..5e992cc1db Binary files /dev/null and b/themes/Default/images/gimp-dialog-info.png differ diff --git a/themes/Default/images/gimp-dialog-question.png b/themes/Default/images/gimp-dialog-question.png new file mode 100644 index 0000000000..60abcc89c0 Binary files /dev/null and b/themes/Default/images/gimp-dialog-question.png differ diff --git a/themes/Default/images/gimp-dialog-warning.png b/themes/Default/images/gimp-dialog-warning.png new file mode 100644 index 0000000000..8400cf40eb Binary files /dev/null and b/themes/Default/images/gimp-dialog-warning.png differ