Add icon to alertpanel
[claws.git] / src / alertpanel.c
index 1387c5f9c9660e63f6f2e5d9c1616ab18715c5e7..163e0c2489113cf73400f0c4bf58afe430394235 100644 (file)
@@ -21,6 +21,7 @@
 #  include "config.h"
 #endif
 
+#include <stddef.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -31,7 +32,6 @@
 #include "utils.h"
 #include "gtkutils.h"
 #include "inc.h"
-#include "log.h"
 #include "logwindow.h"
 #include "prefs_common.h"
 
@@ -39,7 +39,7 @@
 #define TITLE_HEIGHT           72
 #define MESSAGE_HEIGHT         62
 
-#define DEFAULT_TITLE_FONT     "Helvetica 16"
+#define DEFAULT_TITLE_FONT     "Sans Bold 12"
 
 static gboolean alertpanel_is_open = FALSE;
 static AlertValue value;
@@ -222,6 +222,7 @@ static void alertpanel_create(const gchar *title,
 {
        static PangoFontDescription *font_desc;
        GtkWidget *label;
+       GtkWidget *w_hbox;
        GtkWidget *hbox;
        GtkWidget *vbox;
        GtkWidget *spc_vbox;
@@ -231,6 +232,7 @@ static void alertpanel_create(const gchar *title,
        GtkWidget *button1;
        GtkWidget *button2;
        GtkWidget *button3;
+       GtkWidget *icon;
        const gchar *label2;
        const gchar *label3;
 
@@ -251,16 +253,19 @@ static void alertpanel_create(const gchar *title,
        gtk_widget_realize(dialog);
 
        /* for title label */
+       w_hbox = gtk_hbox_new(FALSE, 0);
+       icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING,
+                                       GTK_ICON_SIZE_DIALOG); 
+       gtk_box_pack_start(GTK_BOX(w_hbox), icon, FALSE, FALSE, 16);
        hbox = gtk_hbox_new(FALSE, 0);
+       gtk_box_pack_start(GTK_BOX(w_hbox), hbox, FALSE, FALSE, 2);
        gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
-                          hbox, TRUE, TRUE, 16);
+                          w_hbox, TRUE, TRUE, 16);
+
 
-       /* title label */
-       /* pixmapwid = create_pixmapwid(dialog, GNUstep_xpm); */
-       /* gtk_box_pack_start(GTK_BOX(hbox), pixmapwid, FALSE, FALSE, 16); */
        label = gtk_label_new(title);
-       gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 16);
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+       gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
        if (!font_desc) {
                gchar *fontstr = prefs_common.titlefont
                                        ? prefs_common.titlefont
@@ -270,6 +275,7 @@ static void alertpanel_create(const gchar *title,
        if (font_desc) {
                gtk_widget_modify_font (label, font_desc);
        }
+       gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 16);
 
        /* for message and button(s) */
        vbox = gtk_vbox_new(FALSE, 0);