From a09a95559ef640f23da644aef845607774c79f38 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 24 Mar 2011 16:47:53 -0400 Subject: Fix alignment of extra widgets in EAlertDialogs. Add e_alert_dialog_get_content_area(), which returns the GtkVBox containing the primary and secondary labels. Use this instead of gtk_dialog_get_content_area() to maintain the dialog's left margin beneath the image. --- plugins/attachment-reminder/attachment-reminder.c | 23 ++++++++++++---------- .../org-gnome-attachment-reminder.error.xml | 2 +- plugins/backup-restore/backup-restore.c | 17 +++++++++------- 3 files changed, 24 insertions(+), 18 deletions(-) (limited to 'plugins') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 723e8cfe5d..113424bd78 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -105,26 +105,29 @@ org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t) static gboolean ask_for_missing_attachment (EPlugin *ep, GtkWindow *window) { - GtkWidget *check = NULL; - GtkDialog *dialog = NULL; - GtkWidget *content_area; + GtkWidget *check; + GtkWidget *dialog; + GtkWidget *container; gint response; - dialog = (GtkDialog*) e_alert_dialog_new_for_args ( - window, "org.gnome.evolution.plugins.attachment_reminder:attachment-reminder", NULL); + dialog = e_alert_dialog_new_for_args ( + window, "org.gnome.evolution.plugins.attachment_reminder:" + "attachment-reminder", NULL); + + container = e_alert_dialog_get_content_area (E_ALERT_DIALOG (dialog)); /*Check buttons*/ - check = gtk_check_button_new_with_mnemonic (_("_Do not show this message again.")); - content_area = gtk_dialog_get_content_area (dialog); - gtk_box_pack_start (GTK_BOX (content_area), check, FALSE, FALSE, 0); + check = gtk_check_button_new_with_mnemonic ( + _("_Do not show this message again.")); + gtk_box_pack_start (GTK_BOX (container), check, FALSE, FALSE, 0); gtk_widget_show (check); - response = gtk_dialog_run ((GtkDialog *) dialog); + response = gtk_dialog_run (GTK_DIALOG (dialog)); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) e_plugin_enable (ep, FALSE); - gtk_widget_destroy ((GtkWidget *)dialog); + gtk_widget_destroy (dialog); if (response == GTK_RESPONSE_OK) gtk_action_activate (E_COMPOSER_ACTION_ATTACH (window)); diff --git a/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml b/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml index 4d77f4475b..8728c98747 100644 --- a/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml +++ b/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml @@ -4,7 +4,7 @@ <_primary>Message has no attachments <_secondary>Evolution has found some keywords that suggest that this message should contain an attachment, but cannot find one. - diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c index 2ff0ff1bc9..aa0693ece3 100644 --- a/plugins/backup-restore/backup-restore.c +++ b/plugins/backup-restore/backup-restore.c @@ -113,7 +113,9 @@ sanity_check (const gchar *filename) static guint32 dialog_prompt_user (GtkWindow *parent, const gchar *string, const gchar *tag, ...) { - GtkWidget *mbox, *check = NULL; + GtkWidget *dialog; + GtkWidget *check = NULL; + GtkWidget *container; va_list ap; gint button; guint32 mask = 0; @@ -123,24 +125,25 @@ dialog_prompt_user (GtkWindow *parent, const gchar *string, const gchar *tag, .. alert = e_alert_new_valist (tag, ap); va_end (ap); - mbox = e_alert_dialog_new (parent, alert); + dialog = e_alert_dialog_new (parent, alert); g_object_unref (alert); + container = e_alert_dialog_get_content_area (E_ALERT_DIALOG (dialog)); + check = gtk_check_button_new_with_mnemonic (string); /* We should hardcode this to true */ - gtk_toggle_button_set_active ((GtkToggleButton *)check, TRUE); - gtk_container_set_border_width ((GtkContainer *)check, 12); - gtk_box_pack_start ((GtkBox *)gtk_dialog_get_content_area ((GtkDialog *) mbox), check, TRUE, TRUE, 0); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); + gtk_box_pack_start (GTK_BOX (container), check, FALSE, FALSE, 0); gtk_widget_show (check); - button = gtk_dialog_run ((GtkDialog *) mbox); + button = gtk_dialog_run (GTK_DIALOG (dialog)); if (button == GTK_RESPONSE_YES) mask |= BR_OK; if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) mask |= BR_START; - gtk_widget_destroy (mbox); + gtk_widget_destroy (dialog); return mask; } -- cgit