[evolution/wip/webkit-composer: 46/262] Dialogs refactoring and fixes



commit 3b6109c35a9c682acf87efd7b7845482c9c20a1f
Author: Dan Vrátil <dvratil redhat com>
Date:   Mon Aug 20 15:42:12 2012 +0200

    Dialogs refactoring and fixes
    
     - move more common code to EEditorDialo base class
     - add mnemonics
     - fix layouts and aligment

 e-util/e-editor-cell-dialog.c        |   70 ++++++++++++++--------------------
 e-util/e-editor-dialog.c             |   62 ++++++++++++++++++++++++++++++
 e-util/e-editor-dialog.h             |    4 ++
 e-util/e-editor-find-dialog.c        |   29 ++++----------
 e-util/e-editor-hrule-dialog.c       |   49 ++++++++---------------
 e-util/e-editor-image-dialog.c       |   68 +++++++++++++++------------------
 e-util/e-editor-link-dialog.c        |   33 +++++-----------
 e-util/e-editor-page-dialog.c        |   51 ++++++++-----------------
 e-util/e-editor-paragraph-dialog.c   |   32 ++++------------
 e-util/e-editor-replace-dialog.c     |   32 +++------------
 e-util/e-editor-spell-check-dialog.c |   20 +---------
 e-util/e-editor-table-dialog.c       |   61 +++++++++++++----------------
 e-util/e-editor-text-dialog.c        |   35 ++++------------
 13 files changed, 228 insertions(+), 318 deletions(-)
---
diff --git a/e-util/e-editor-cell-dialog.c b/e-util/e-editor-cell-dialog.c
index 1b4700a..c3995d0 100644
--- a/e-util/e-editor-cell-dialog.c
+++ b/e-util/e-editor-cell-dialog.c
@@ -64,8 +64,6 @@ struct _EEditorCellDialogPrivate {
        GtkWidget *background_color_picker;
        GtkWidget *background_image_chooser;
 
-       GtkWidget *close_button;
-
        WebKitDOMElement *cell;
        guint scope;
 };
@@ -562,35 +560,32 @@ e_editor_cell_dialog_class_init (EEditorCellDialogClass *klass)
 static void
 e_editor_cell_dialog_init (EEditorCellDialog *dialog)
 {
-       GtkBox *main_layout;
-       GtkGrid *grid;
+       GtkGrid *main_layout, *grid;
        GtkWidget *widget;
        GtkFileFilter *file_filter;
 
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_CELL_DIALOG, EEditorCellDialogPrivate);
 
-       main_layout = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 5));
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        /* == Scope == */
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Scope</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 1, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Scope: cell */
        widget = gtk_image_new_from_icon_name ("stock_select-cell", GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
 
-       widget = gtk_radio_button_new_with_mnemonic(NULL, _("Cell"));
+       widget = gtk_radio_button_new_with_mnemonic(NULL, _("C_ell"));
        gtk_grid_attach (grid, widget, 1, 0, 1, 1);
        dialog->priv->scope_cell_button = widget;
 
@@ -603,7 +598,7 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
        gtk_grid_attach (grid, widget, 2, 0, 1, 1);
 
        widget = gtk_radio_button_new_with_mnemonic_from_widget (
-               GTK_RADIO_BUTTON (dialog->priv->scope_cell_button), _("Row"));
+               GTK_RADIO_BUTTON (dialog->priv->scope_cell_button), _("_Row"));
        gtk_grid_attach (grid, widget, 3, 0, 1, 1);
        dialog->priv->scope_row_button = widget;
 
@@ -616,7 +611,7 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
        widget = gtk_radio_button_new_with_mnemonic_from_widget (
-               GTK_RADIO_BUTTON (dialog->priv->scope_cell_button), _("Table"));
+               GTK_RADIO_BUTTON (dialog->priv->scope_cell_button), _("_Table"));
        gtk_grid_attach (grid, widget, 1, 1, 1, 1);
        dialog->priv->scope_table_button = widget;
 
@@ -629,7 +624,7 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
        gtk_grid_attach (grid, widget, 2, 1, 1, 1);
 
        widget = gtk_radio_button_new_with_mnemonic_from_widget (
-               GTK_RADIO_BUTTON (dialog->priv->scope_cell_button), _("Column"));
+               GTK_RADIO_BUTTON (dialog->priv->scope_cell_button), _("Col_umn"));
        gtk_grid_attach (grid, widget, 3, 1, 1, 1);
        dialog->priv->scope_column_button = widget;
 
@@ -641,12 +636,12 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Alignment &amp; Behavior</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 3, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Horizontal */
@@ -662,7 +657,8 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
                widget, "changed",
                G_CALLBACK (editor_cell_dialog_set_halign), dialog);
 
-       widget = gtk_label_new_with_mnemonic (_("Horizontal:"));
+       widget = gtk_label_new_with_mnemonic (_("_Horizontal:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->halign_combo);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
 
@@ -679,12 +675,13 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
                widget, "changed",
                G_CALLBACK (editor_cell_dialog_set_valign), dialog);
 
-       widget = gtk_label_new_with_mnemonic (_("Vertical:"));
+       widget = gtk_label_new_with_mnemonic (_("_Vertical:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->valign_combo);
        gtk_grid_attach (grid, widget, 2, 0, 1, 1);
 
        /* Wrap Text */
-       widget = gtk_check_button_new_with_mnemonic (_("Wrap Text"));
+       widget = gtk_check_button_new_with_mnemonic (_("_Wrap Text"));
        dialog->priv->wrap_text_check = widget;
 
        g_signal_connect_swapped (
@@ -692,7 +689,7 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
                G_CALLBACK (editor_cell_dialog_set_wrap_text), dialog);
 
        /* Header Style */
-       widget = gtk_check_button_new_with_mnemonic (_("Header Style"));
+       widget = gtk_check_button_new_with_mnemonic (_("_Header Style"));
        dialog->priv->header_style_check = widget;
 
        g_signal_connect_swapped (
@@ -708,16 +705,16 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Layout</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 4, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 5, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Width */
-       widget = gtk_check_button_new_with_mnemonic (_("Width"));
+       widget = gtk_check_button_new_with_mnemonic (_("_Width"));
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
        dialog->priv->width_check = widget;
 
@@ -756,7 +753,8 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
                widget, "value-changed",
                G_CALLBACK (editor_cell_dialog_set_row_span), dialog);
 
-       widget = gtk_label_new_with_mnemonic (_("Row Span:"));
+       widget = gtk_label_new_with_mnemonic (_("Row S_pan:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->row_span_edit);
        gtk_grid_attach (grid, widget, 3, 0, 1, 1);
 
@@ -769,7 +767,8 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
                widget, "value-changed",
                G_CALLBACK (editor_cell_dialog_set_column_span), dialog);
 
-       widget = gtk_label_new_with_mnemonic (_("Column Span:"));
+       widget = gtk_label_new_with_mnemonic (_("Co_lumn Span:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->col_span_edit);
        gtk_grid_attach (grid, widget, 3, 1, 1, 1);
 
@@ -777,12 +776,12 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Background</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 6, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 7, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Color */
@@ -795,7 +794,8 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
                G_CALLBACK (editor_cell_dialog_set_background_color), dialog);
        dialog->priv->background_color_picker = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("_Color:"));
+       widget = gtk_label_new_with_mnemonic (_("C_olor:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_color_picker);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
@@ -821,24 +821,12 @@ e_editor_cell_dialog_init (EEditorCellDialog *dialog)
        dialog->priv->background_image_chooser = widget;
 
 
-       widget =gtk_label_new_with_mnemonic (_("Image:"));
+       widget =gtk_label_new_with_mnemonic (_("_Image:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_image_chooser);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
-       /* == Button box == */
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (gtk_widget_hide), dialog);
-       dialog->priv->close_button = widget;
-
-       widget = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_END);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (widget), TRUE, TRUE, 0);
-       gtk_box_pack_start (
-               GTK_BOX (widget), dialog->priv->close_button, FALSE, FALSE, 0);
-
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
diff --git a/e-util/e-editor-dialog.c b/e-util/e-editor-dialog.c
index 717a534..5f6a18f 100644
--- a/e-util/e-editor-dialog.c
+++ b/e-util/e-editor-dialog.c
@@ -29,6 +29,9 @@ G_DEFINE_ABSTRACT_TYPE (
 
 struct _EEditorDialogPrivate {
        EEditor *editor;
+
+       GtkBox *button_box;
+       GtkGrid *container;
 };
 
 enum {
@@ -83,6 +86,15 @@ editor_dialog_set_property (GObject *object,
 }
 
 static void
+editor_dialog_show (GtkWidget *widget)
+{
+       gtk_widget_show_all (GTK_WIDGET (E_EDITOR_DIALOG (widget)->priv->container));
+       gtk_widget_show_all (GTK_WIDGET (E_EDITOR_DIALOG (widget)->priv->button_box));
+
+       GTK_WIDGET_CLASS (e_editor_dialog_parent_class)->show (widget);
+}
+
+static void
 editor_dialog_dispose (GObject *object)
 {
        EEditorDialogPrivate *priv = E_EDITOR_DIALOG (object)->priv;
@@ -97,6 +109,7 @@ static void
 e_editor_dialog_class_init (EEditorDialogClass *klass)
 {
        GObjectClass *object_class;
+       GtkWidgetClass *widget_class;
 
        g_type_class_peek_parent (klass);
        g_type_class_add_private (klass, sizeof (EEditorDialogPrivate));
@@ -106,6 +119,9 @@ e_editor_dialog_class_init (EEditorDialogClass *klass)
        object_class->set_property = editor_dialog_set_property;
        object_class->dispose = editor_dialog_dispose;
 
+       widget_class = GTK_WIDGET_CLASS (klass);
+       widget_class->show = editor_dialog_show;
+
        g_object_class_install_property (
                object_class,
                PROP_EDITOR,
@@ -120,9 +136,38 @@ e_editor_dialog_class_init (EEditorDialogClass *klass)
 static void
 e_editor_dialog_init (EEditorDialog *dialog)
 {
+       GtkBox *main_layout;
+       GtkGrid *grid;
+       GtkWidget *widget, *button_box;
+
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_DIALOG, EEditorDialogPrivate);
 
+       main_layout = GTK_BOX (gtk_vbox_new (FALSE, 5));
+       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
+       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+
+       grid = GTK_GRID (gtk_grid_new ());
+       gtk_grid_set_row_spacing (grid, 10);
+       gtk_grid_set_column_spacing (grid, 10);
+       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 5);
+       dialog->priv->container = grid;
+
+       /* == Button box == */
+       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+       g_signal_connect_swapped (
+               widget, "clicked",
+               G_CALLBACK (gtk_widget_hide), dialog);
+
+       button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+       gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_END);
+       gtk_box_set_spacing (GTK_BOX (button_box), 5);
+       gtk_box_pack_start (main_layout, button_box, TRUE, TRUE, 5);
+       gtk_box_pack_start (GTK_BOX (button_box), widget, FALSE, FALSE, 5);
+       dialog->priv->button_box = GTK_BOX (button_box);
+
+       gtk_widget_show_all (GTK_WIDGET (main_layout));
+
        g_object_set (
                G_OBJECT (dialog),
                "destroy-with-parent", TRUE,
@@ -146,3 +191,20 @@ e_editor_dialog_get_editor (EEditorDialog *dialog)
 
        return dialog->priv->editor;
 }
+
+GtkGrid *
+e_editor_dialog_get_container (EEditorDialog *dialog)
+{
+       g_return_val_if_fail (E_IS_EDITOR_DIALOG (dialog), NULL);
+
+       return dialog->priv->container;
+}
+
+GtkBox *
+e_editor_dialog_get_button_box (EEditorDialog *dialog)
+{
+       g_return_val_if_fail (E_IS_EDITOR_DIALOG (dialog), NULL);
+
+       return dialog->priv->button_box;
+}
+
diff --git a/e-util/e-editor-dialog.h b/e-util/e-editor-dialog.h
index 0fa873d..6f305fd 100644
--- a/e-util/e-editor-dialog.h
+++ b/e-util/e-editor-dialog.h
@@ -65,6 +65,10 @@ GType                e_editor_dialog_get_type        (void);
 
 EEditor *      e_editor_dialog_get_editor      (EEditorDialog *dialog);
 
+GtkBox *       e_editor_dialog_get_button_box  (EEditorDialog *dialog);
+
+GtkGrid *      e_editor_dialog_get_container   (EEditorDialog *dialog);
+
 G_END_DECLS
 
 #endif /* E_EDITOR_DIALOG_H */
diff --git a/e-util/e-editor-find-dialog.c b/e-util/e-editor-find-dialog.c
index b8cb8a3..eeb0553 100644
--- a/e-util/e-editor-find-dialog.c
+++ b/e-util/e-editor-find-dialog.c
@@ -37,7 +37,6 @@ struct _EEditorFindDialogPrivate {
        GtkWidget *wrap_search;
 
        GtkWidget *find_button;
-       GtkWidget *cancel_button;
 
        GtkWidget *result_label;
 };
@@ -62,12 +61,6 @@ editor_find_dialog_show (GtkWidget *widget)
 }
 
 static void
-editor_find_dialog_close_cb (EEditorFindDialog *dialog)
-{
-       gtk_widget_hide (GTK_WIDGET (dialog));
-}
-
-static void
 editor_find_dialog_find_cb (EEditorFindDialog *dialog)
 {
        gboolean found;
@@ -132,25 +125,25 @@ e_editor_find_dialog_class_init (EEditorFindDialogClass *klass)
 static void
 e_editor_find_dialog_init (EEditorFindDialog *dialog)
 {
-       GtkBox *main_layout, *box;
+       GtkGrid *main_layout;
+       GtkBox *box;
        GtkWidget *widget;
 
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_FIND_DIALOG, EEditorFindDialogPrivate);
 
-       main_layout = GTK_BOX (gtk_vbox_new (FALSE, 5));
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        widget = gtk_entry_new ();
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_widget_set_hexpand (widget, TRUE);
+       gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
        dialog->priv->entry = widget;
        g_signal_connect (
                widget, "key-release-event",
                G_CALLBACK (entry_key_release_event), dialog);
 
        box = GTK_BOX (gtk_hbox_new (FALSE, 5));
-       gtk_box_pack_start (main_layout, GTK_WIDGET (box), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (box), 0, 1, 1, 1);
 
        widget = gtk_check_button_new_with_mnemonic (N_("Search _backwards"));
        gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
@@ -174,7 +167,7 @@ e_editor_find_dialog_init (EEditorFindDialog *dialog)
                G_CALLBACK (reset_dialog), dialog);
 
        box = GTK_BOX (gtk_hbox_new (FALSE, 5));
-       gtk_box_pack_start (main_layout, GTK_WIDGET (box), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (box), 0, 2, 1, 1);
 
        widget = gtk_label_new ("");
        gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
@@ -186,13 +179,7 @@ e_editor_find_dialog_init (EEditorFindDialog *dialog)
        gtk_box_pack_end (box, widget, TRUE, TRUE, 0);
        box = GTK_BOX (widget);
 
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       gtk_box_pack_start (box, widget, FALSE, FALSE, 5);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (editor_find_dialog_close_cb), dialog);
-       dialog->priv->cancel_button = widget;
-
+       box = e_editor_dialog_get_button_box (E_EDITOR_DIALOG (dialog));
        widget = gtk_button_new_from_stock (GTK_STOCK_FIND);
        gtk_box_pack_start (box, widget, FALSE, FALSE, 5);
        g_signal_connect_swapped (
diff --git a/e-util/e-editor-hrule-dialog.c b/e-util/e-editor-hrule-dialog.c
index 0528c12..110b033 100644
--- a/e-util/e-editor-hrule-dialog.c
+++ b/e-util/e-editor-hrule-dialog.c
@@ -40,8 +40,6 @@ struct _EEditorHRuleDialogPrivate {
        GtkWidget *alignment_combo;
        GtkWidget *shaded_check;
 
-       GtkWidget *close_button;
-
        WebKitDOMHTMLHRElement *hr_element;
 };
 
@@ -188,11 +186,11 @@ editor_hrule_dialog_get_shading (EEditorHRuleDialog *dialog)
 }
 
 static void
-editor_hrule_dialog_close (EEditorHRuleDialog *dialog)
+editor_hrule_dialog_hide (GtkWidget *gtk_widget)
 {
-       gtk_widget_hide (GTK_WIDGET (dialog));
+       E_EDITOR_HRULE_DIALOG (gtk_widget)->priv->hr_element = NULL;
 
-       dialog->priv->hr_element = NULL;
+       GTK_WIDGET_CLASS (e_editor_hrule_dialog_parent_class)->hide (gtk_widget);
 }
 
 static void
@@ -278,34 +276,31 @@ e_editor_hrule_dialog_class_init (EEditorHRuleDialogClass *klass)
 
        widget_class = GTK_WIDGET_CLASS (klass);
        widget_class->show = editor_hrule_dialog_show;
+       widget_class->hide = editor_hrule_dialog_hide;
 }
 
 static void
 e_editor_hrule_dialog_init (EEditorHRuleDialog *dialog)
 {
-       GtkBox *main_layout;
-       GtkGrid *grid;
+       GtkGrid *main_layout, *grid;
        GtkWidget *widget;
 
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_HRULE_DIALOG, EEditorHRuleDialogPrivate);
 
-       main_layout = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 5));
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
-
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        /* == Size == */
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Size</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_column_spacing (grid, 5);
        gtk_grid_set_row_spacing (grid, 5);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 1, 1, 1);
 
        /* Width */
        widget = gtk_spin_button_new_with_range (0.0, 100.0, 1.0);
@@ -317,7 +312,8 @@ e_editor_hrule_dialog_init (EEditorHRuleDialog *dialog)
        dialog->priv->width_edit = widget;
        gtk_grid_attach (grid, widget, 1, 0, 1, 1);
 
-       widget = gtk_label_new_with_mnemonic (_("Width:"));
+       widget = gtk_label_new_with_mnemonic (_("_Width:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->size_edit);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
 
@@ -341,7 +337,8 @@ e_editor_hrule_dialog_init (EEditorHRuleDialog *dialog)
        dialog->priv->size_edit = widget;
        gtk_grid_attach (grid, widget, 1, 1, 1, 1);
 
-       widget = gtk_label_new_with_mnemonic (_("Size:"));
+       widget = gtk_label_new_with_mnemonic (_("_Size:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->size_edit);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
@@ -350,13 +347,13 @@ e_editor_hrule_dialog_init (EEditorHRuleDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Style</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_column_spacing (grid, 5);
        gtk_grid_set_row_spacing (grid, 5);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 3, 1, 1);
 
        /* Alignment */
        widget = gtk_combo_box_text_new ();
@@ -373,31 +370,19 @@ e_editor_hrule_dialog_init (EEditorHRuleDialog *dialog)
        dialog->priv->alignment_combo = widget;
        gtk_grid_attach (grid, widget, 1, 0, 2, 1);
 
-       widget = gtk_label_new_with_mnemonic (_("Alignment:"));
+       widget = gtk_label_new_with_mnemonic (_("_Alignment:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), widget);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
 
        /* Shaded */
-       widget = gtk_check_button_new_with_mnemonic (_("Shaded"));
+       widget = gtk_check_button_new_with_mnemonic (_("S_haded"));
        g_signal_connect_swapped (
                widget, "toggled",
                G_CALLBACK (editor_hrule_dialog_set_shading), dialog);
        dialog->priv->shaded_check = widget;
        gtk_grid_attach (grid, widget, 0, 1, 2, 1);
 
-
-       /* == Button box == */
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (editor_hrule_dialog_close), dialog);
-       dialog->priv->close_button = widget;
-
-       widget = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_END);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 0);
-       gtk_box_pack_start (GTK_BOX (widget), dialog->priv->close_button, FALSE, FALSE, 5);
-
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
diff --git a/e-util/e-editor-image-dialog.c b/e-util/e-editor-image-dialog.c
index 40686e0..0004e8d 100644
--- a/e-util/e-editor-image-dialog.c
+++ b/e-util/e-editor-image-dialog.c
@@ -50,8 +50,6 @@ struct _EEditorImageDialogPrivate {
        GtkWidget *url_edit;
        GtkWidget *test_url_button;
 
-       GtkWidget *close_button;
-
        WebKitDOMHTMLImageElement *image;
 };
 
@@ -391,11 +389,11 @@ editor_image_dialog_show (GtkWidget *gtk_widget)
 }
 
 static void
-editor_image_dialog_close (EEditorImageDialog *dialog)
+editor_image_dialog_hide (GtkWidget *gtk_widget)
 {
-       dialog->priv->image = NULL;
+       E_EDITOR_IMAGE_DIALOG (gtk_widget)->priv->image = NULL;
 
-       gtk_widget_hide (GTK_WIDGET (dialog));
+       GTK_WIDGET_CLASS (e_editor_image_dialog_parent_class)->hide (gtk_widget);
 }
 
 static void
@@ -408,33 +406,31 @@ e_editor_image_dialog_class_init (EEditorImageDialogClass *klass)
 
        widget_class = GTK_WIDGET_CLASS (klass);
        widget_class->show = editor_image_dialog_show;
+       widget_class->hide = editor_image_dialog_hide;
 }
 
 static void
 e_editor_image_dialog_init (EEditorImageDialog *dialog)
 {
-       GtkBox *main_layout;
-       GtkGrid *grid;
+       GtkGrid *main_layout, *grid;
        GtkWidget *widget;
        GtkFileFilter *file_filter;
 
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_IMAGE_DIALOG, EEditorImageDialogPrivate);
 
-       main_layout = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 5));
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        /* == General == */
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>General</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 1, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Source */
@@ -456,7 +452,8 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_src), dialog);
        dialog->priv->file_chooser = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Source:"));
+       widget = gtk_label_new_with_mnemonic (_("_Source:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->file_chooser);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
 
@@ -469,7 +466,8 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_alt), dialog);
        dialog->priv->description_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Description:"));
+       widget = gtk_label_new_with_mnemonic (_("_Description:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->description_edit);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
@@ -478,12 +476,12 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Layout</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 3, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Width */
@@ -494,7 +492,8 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_width), dialog);
        dialog->priv->width_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Width:"));
+       widget = gtk_label_new_with_mnemonic (_("_Width:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->width_edit);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
 
@@ -517,7 +516,8 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_height), dialog);
        dialog->priv->height_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Height:"));
+       widget = gtk_label_new_with_mnemonic (_("_Height:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->height_edit);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
@@ -544,7 +544,8 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_alignment), dialog);
        dialog->priv->alignment = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Alignment"));
+       widget = gtk_label_new_with_mnemonic (_("_Alignment"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->alignment);
        gtk_grid_attach (grid, widget, 0, 2, 1, 1);
 
@@ -556,7 +557,8 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_x_padding), dialog);
        dialog->priv->x_padding_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("X-Padding:"));
+       widget = gtk_label_new_with_mnemonic (_("_X-Padding:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->x_padding_edit);
        gtk_grid_attach (grid, widget, 4, 0, 1, 1);
 
@@ -571,7 +573,8 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_y_padding), dialog);
        dialog->priv->y_padding_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Y-Padding:"));
+       widget = gtk_label_new_with_mnemonic (_("_Y-Padding:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->y_padding_edit);
        gtk_grid_attach (grid, widget, 4, 1, 1, 1);
 
@@ -586,7 +589,8 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_border), dialog);
        dialog->priv->border_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Border:"));
+       widget = gtk_label_new_with_mnemonic (_("_Border:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->border_edit);
        gtk_grid_attach (grid, widget, 4, 2, 1, 1);
 
@@ -597,12 +601,12 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Link</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 4, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 5, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        widget = gtk_entry_new ();
@@ -613,28 +617,18 @@ e_editor_image_dialog_init (EEditorImageDialog *dialog)
                G_CALLBACK (editor_image_dialog_set_url), dialog);
        dialog->priv->url_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("URL:"));
+       widget = gtk_label_new_with_mnemonic (_("_URL:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->url_edit);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
 
-       widget = gtk_button_new_with_label (_("Test URL..."));
+       widget = gtk_button_new_with_label (_("_Test URL..."));
        gtk_grid_attach (grid, widget, 2, 0, 1, 1);
        g_signal_connect_swapped (
                widget, "clicked",
                G_CALLBACK (editor_image_dialog_test_url), dialog);
        dialog->priv->test_url_button = widget;
 
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (editor_image_dialog_close), dialog);
-       dialog->priv->close_button = widget;
-
-       widget = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_END);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
-       gtk_box_pack_start (GTK_BOX (widget), dialog->priv->close_button, FALSE, FALSE, 5);
-
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
diff --git a/e-util/e-editor-link-dialog.c b/e-util/e-editor-link-dialog.c
index ae7707f..a034cbc 100644
--- a/e-util/e-editor-link-dialog.c
+++ b/e-util/e-editor-link-dialog.c
@@ -37,7 +37,6 @@ struct _EEditorLinkDialogPrivate {
        GtkWidget *test_button;
 
        GtkWidget *remove_link_button;
-       GtkWidget *close_button;
        GtkWidget *ok_button;
 };
 
@@ -267,21 +266,18 @@ e_editor_link_dialog_init (EEditorLinkDialog *dialog)
                                dialog, E_TYPE_EDITOR_LINK_DIALOG,
                                EEditorLinkDialogPrivate);
 
-       main_layout = GTK_GRID (gtk_grid_new ());
-       gtk_grid_set_row_spacing (main_layout, 10);
-       gtk_grid_set_column_spacing (main_layout, 10);
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        widget = gtk_entry_new ();
        gtk_grid_attach (main_layout, widget, 1, 0, 1, 1);
        dialog->priv->url_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("URL:"));
+       widget = gtk_label_new_with_mnemonic (_("_URL:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->url_edit);
        gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
-       widget = gtk_button_new_with_label (_("Test URL..."));
+       widget = gtk_button_new_with_mnemonic (_("_Test URL..."));
        gtk_grid_attach (main_layout, widget, 2, 0, 1, 1);
        g_signal_connect_swapped (
                widget, "clicked",
@@ -292,23 +288,14 @@ e_editor_link_dialog_init (EEditorLinkDialog *dialog)
        gtk_grid_attach (main_layout, widget, 1, 1, 2, 1);
        dialog->priv->label_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Description:"));
+       widget = gtk_label_new_with_mnemonic (_("_Description:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->label_edit);
        gtk_grid_attach (main_layout, widget, 0, 1, 1, 1);
 
-       button_box = GTK_BOX (gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL));
-       gtk_box_set_spacing (button_box, 5);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_END);
-       gtk_grid_attach (main_layout, GTK_WIDGET (button_box), 0, 2, 3, 1);
-
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (editor_link_dialog_close), dialog);
-       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
-       dialog->priv->close_button = widget;
-
-       widget = gtk_button_new_with_label (_("Remove Link"));
+       button_box = e_editor_dialog_get_button_box (E_EDITOR_DIALOG (dialog));
+       
+       widget = gtk_button_new_with_mnemonic (_("_Remove Link"));
        g_signal_connect_swapped (
                widget, "clicked",
                G_CALLBACK (editor_link_dialog_remove_link), dialog);
@@ -319,7 +306,7 @@ e_editor_link_dialog_init (EEditorLinkDialog *dialog)
        g_signal_connect_swapped (
                widget, "clicked",
                G_CALLBACK (editor_link_dialog_ok), dialog);
-       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
+       gtk_box_pack_end (button_box, widget, FALSE, FALSE, 5);
        dialog->priv->ok_button = widget;
 
        gtk_widget_show_all (GTK_WIDGET (main_layout));
diff --git a/e-util/e-editor-page-dialog.c b/e-util/e-editor-page-dialog.c
index 5c99749..3327361 100644
--- a/e-util/e-editor-page-dialog.c
+++ b/e-util/e-editor-page-dialog.c
@@ -39,8 +39,6 @@ struct _EEditorPageDialogPrivate {
 
        GtkWidget *background_template_combo;
        GtkWidget *background_image_filechooser;
-
-       GtkWidget *close_button;
 };
 
 typedef struct _Template {
@@ -273,12 +271,6 @@ editor_page_dialog_set_background_image (EEditorPageDialog *dialog)
 }
 
 static void
-editor_page_dialog_close (EEditorPageDialog *dialog)
-{
-       gtk_widget_hide (GTK_WIDGET (dialog));
-}
-
-static void
 editor_page_dialog_show (GtkWidget *widget)
 {
        EEditor *editor;
@@ -391,28 +383,25 @@ e_editor_page_dialog_class_init (EEditorPageDialogClass *klass)
 static void
 e_editor_page_dialog_init (EEditorPageDialog *dialog)
 {
-       GtkBox *main_layout;
-       GtkGrid *grid;
+       GtkGrid *grid, *main_layout;
        GtkWidget *widget;
        gint ii;
 
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_PAGE_DIALOG, EEditorPageDialogPrivate);
 
-       main_layout = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 5));
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        /* == Colors == */
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Colors</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 1, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Text */
@@ -424,7 +413,8 @@ e_editor_page_dialog_init (EEditorPageDialog *dialog)
        gtk_grid_attach (grid, widget, 1, 0, 1, 1);
        dialog->priv->text_color_picker = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Text:"));
+       widget = gtk_label_new_with_mnemonic (_("_Text:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);  
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->text_color_picker);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
@@ -438,7 +428,8 @@ e_editor_page_dialog_init (EEditorPageDialog *dialog)
        gtk_grid_attach (grid, widget, 1, 1, 1, 1);
        dialog->priv->link_color_picker = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Link:"));
+       widget = gtk_label_new_with_mnemonic (_("_Link:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->link_color_picker);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
@@ -452,7 +443,8 @@ e_editor_page_dialog_init (EEditorPageDialog *dialog)
        gtk_grid_attach (grid, widget, 1, 2, 1, 1);
        dialog->priv->background_color_picker = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Background:"));
+       widget = gtk_label_new_with_mnemonic (_("_Background:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_color_picker);
        gtk_grid_attach (grid, widget, 0, 2, 1, 1);
@@ -461,12 +453,12 @@ e_editor_page_dialog_init (EEditorPageDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Background Image</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 3, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Template */
@@ -481,7 +473,8 @@ e_editor_page_dialog_init (EEditorPageDialog *dialog)
        gtk_grid_attach (grid, widget, 1, 0, 1, 1);
        dialog->priv->background_template_combo = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Template:"));
+       widget = gtk_label_new_with_mnemonic (_("_Template:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_template_combo);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
@@ -495,24 +488,12 @@ e_editor_page_dialog_init (EEditorPageDialog *dialog)
        gtk_grid_attach (grid, widget, 1, 1, 1, 1);
        dialog->priv->background_image_filechooser = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Custom:"));
+       widget = gtk_label_new_with_mnemonic (_("_Custom:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_image_filechooser);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
-
-       /* == Button box == */
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (editor_page_dialog_close), dialog);
-       dialog->priv->close_button = widget;
-
-       widget = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_END);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 0);
-       gtk_box_pack_start (GTK_BOX (widget), dialog->priv->close_button, FALSE, FALSE, 5);
-
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
diff --git a/e-util/e-editor-paragraph-dialog.c b/e-util/e-editor-paragraph-dialog.c
index 2a7c398..7b4327f 100644
--- a/e-util/e-editor-paragraph-dialog.c
+++ b/e-util/e-editor-paragraph-dialog.c
@@ -37,15 +37,12 @@ struct _EEditorParagraphDialogPrivate {
        GtkWidget *left_button;
        GtkWidget *center_button;
        GtkWidget *right_button;
-
-       GtkWidget *close_button;
 };
 
 static void
 editor_paragraph_dialog_constructed (GObject *object)
 {
-       GtkBox *main_layout;
-       GtkGrid *grid;
+       GtkGrid *main_layout, *grid;
        GtkWidget *widget;
        EEditor *editor;
        EEditorParagraphDialog *dialog;
@@ -53,20 +50,18 @@ editor_paragraph_dialog_constructed (GObject *object)
        dialog = E_EDITOR_PARAGRAPH_DIALOG (object);
        editor = e_editor_dialog_get_editor (E_EDITOR_DIALOG (dialog));
 
-       main_layout = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 5));
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        /* == General == */
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>General</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 1, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Style */
@@ -76,7 +71,8 @@ editor_paragraph_dialog_constructed (GObject *object)
        gtk_grid_attach (grid, widget, 1, 0, 1, 1);
        dialog->priv->style_combo = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Style:"));
+       widget = gtk_label_new_with_mnemonic (_("_Style:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->style_combo);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
 
@@ -84,12 +80,12 @@ editor_paragraph_dialog_constructed (GObject *object)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Alignment</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 3, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Left */
@@ -119,18 +115,6 @@ editor_paragraph_dialog_constructed (GObject *object)
                e_editor_get_action (editor, "justify-right"));
        dialog->priv->right_button = widget;
 
-       /* == Button box == */
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (gtk_widget_hide), dialog);
-       dialog->priv->close_button = widget;
-
-       widget = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_END);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
-       gtk_box_pack_start (GTK_BOX (widget), dialog->priv->close_button, FALSE, FALSE, 5);
-
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
diff --git a/e-util/e-editor-replace-dialog.c b/e-util/e-editor-replace-dialog.c
index b372d05..52df61a 100644
--- a/e-util/e-editor-replace-dialog.c
+++ b/e-util/e-editor-replace-dialog.c
@@ -39,7 +39,6 @@ struct _EEditorReplaceDialogPrivate {
 
        GtkWidget *result_label;
 
-       GtkWidget *close_button;
        GtkWidget *skip_button;
        GtkWidget *replace_button;
        GtkWidget *replace_all_button;
@@ -136,12 +135,6 @@ editor_replace_dialog_replace_all_cb (EEditorReplaceDialog *dialog)
 }
 
 static void
-editor_replace_dialog_close_cb (EEditorReplaceDialog *dialog)
-{
-       gtk_widget_hide (GTK_WIDGET (dialog));
-}
-
-static void
 editor_replace_dialog_entry_changed (EEditorReplaceDialog *dialog)
 {
        gboolean ready;
@@ -184,16 +177,13 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
 {
        GtkGrid *main_layout;
        GtkWidget *widget, *layout;
+       GtkBox *button_box;
 
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                                dialog, E_TYPE_EDITOR_REPLACE_DIALOG,
                                EEditorReplaceDialogPrivate);
 
-       main_layout = GTK_GRID (gtk_grid_new ());
-       gtk_grid_set_row_spacing (main_layout, 10);
-       gtk_grid_set_column_spacing (main_layout, 10);
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        widget = gtk_entry_new ();
        gtk_grid_attach (main_layout, widget, 1, 0, 2, 1);
@@ -238,20 +228,10 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
        gtk_grid_attach (main_layout, widget, 0, 3, 2, 1);
        dialog->priv->result_label = widget;
 
-       layout = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_box_set_spacing (GTK_BOX (layout), 5);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (layout), GTK_BUTTONBOX_START);
-       gtk_grid_attach (main_layout, layout, 2, 3, 1, 1);
-
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       gtk_box_pack_start (GTK_BOX (layout), widget, FALSE, FALSE, 5);
-       dialog->priv->close_button = widget;
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (editor_replace_dialog_close_cb), dialog);
+       button_box = e_editor_dialog_get_button_box (E_EDITOR_DIALOG (dialog));
 
        widget = gtk_button_new_with_mnemonic (_("_Skip"));
-       gtk_box_pack_start (GTK_BOX (layout), widget, FALSE, FALSE, 5);
+       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
        gtk_widget_set_sensitive (widget, FALSE);
        dialog->priv->skip_button = widget;
        g_signal_connect_swapped (
@@ -259,7 +239,7 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
                G_CALLBACK (editor_replace_dialog_skip_cb), dialog);
 
        widget = gtk_button_new_with_mnemonic (_("_Replace"));
-       gtk_box_pack_start (GTK_BOX (layout), widget, FALSE, FALSE, 5);
+       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
        gtk_widget_set_sensitive (widget, FALSE);
        dialog->priv->replace_button = widget;
        g_signal_connect_swapped (
@@ -267,7 +247,7 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
                G_CALLBACK (editor_replace_dialog_replace_cb), dialog);
 
        widget = gtk_button_new_with_mnemonic (_("Replace _All"));
-       gtk_box_pack_start (GTK_BOX (layout), widget, FALSE, FALSE, 5);
+       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
        gtk_widget_set_sensitive (widget, FALSE);
        dialog->priv->replace_all_button = widget;
        g_signal_connect_swapped (
diff --git a/e-util/e-editor-spell-check-dialog.c b/e-util/e-editor-spell-check-dialog.c
index f2c8714..2447ec5 100644
--- a/e-util/e-editor-spell-check-dialog.c
+++ b/e-util/e-editor-spell-check-dialog.c
@@ -48,7 +48,6 @@ struct _EEditorSpellCheckDialogPrivate {
        GtkWidget *skip_button;
        GtkWidget *suggestion_label;
        GtkWidget *tree_view;
-       GtkWidget *close_button;
 
        GList *dictionaries;
        WebKitDOMDOMSelection *selection;
@@ -441,11 +440,7 @@ e_editor_spell_check_dialog_init (EEditorSpellCheckDialog *dialog)
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_SPELL_CHECK_DIALOG, EEditorSpellCheckDialogPrivate);
 
-       main_layout = GTK_GRID (gtk_grid_new ());
-       gtk_grid_set_row_spacing (main_layout, 10);
-       gtk_grid_set_column_spacing (main_layout, 10);
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        /* == Suggestions == */
        widget = gtk_label_new ("");
@@ -581,19 +576,6 @@ e_editor_spell_check_dialog_init (EEditorSpellCheckDialog *dialog)
                widget, "clicked",
                G_CALLBACK (editor_spell_check_dialog_learn), dialog);
 
-       /* Close Button */
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       dialog->priv->close_button = widget;
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (gtk_widget_hide), dialog);
-
-       /* Button box */
-       widget = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_END);
-       gtk_grid_attach (main_layout, widget, 0, 8, 2, 1);
-       gtk_box_pack_start (GTK_BOX (widget), dialog->priv->close_button, FALSE, FALSE, 5);
-
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
diff --git a/e-util/e-editor-table-dialog.c b/e-util/e-editor-table-dialog.c
index 20fde99..a3a8a71 100644
--- a/e-util/e-editor-table-dialog.c
+++ b/e-util/e-editor-table-dialog.c
@@ -52,8 +52,6 @@ struct _EEditorTableDialogPrivate {
        GtkWidget *background_image_button;
        GtkWidget *image_chooser_dialog;
 
-       GtkWidget *close_button;
-
        WebKitDOMHTMLTableElement *table_element;
 };
 
@@ -481,14 +479,6 @@ editor_table_dialog_get_background_image (EEditorTableDialog *dialog)
 }
 
 static void
-editor_table_dialog_close (EEditorTableDialog *dialog)
-{
-       gtk_widget_hide (GTK_WIDGET (dialog));
-
-       dialog->priv->table_element = NULL;
-}
-
-static void
 editor_table_dialog_get_values (EEditorTableDialog *dialog)
 {
        editor_table_dialog_get_row_count (dialog);
@@ -584,6 +574,14 @@ editor_table_dialog_show (GtkWidget *widget)
 }
 
 static void
+editor_table_dialog_hide (GtkWidget *widget)
+{
+       E_EDITOR_TABLE_DIALOG (widget)->priv->table_element = NULL;
+
+       GTK_WIDGET_CLASS (e_editor_table_dialog_parent_class)->hide (widget);
+}
+
+static void
 e_editor_table_dialog_class_init (EEditorTableDialogClass *klass)
 {
        GtkWidgetClass *widget_class;
@@ -593,33 +591,31 @@ e_editor_table_dialog_class_init (EEditorTableDialogClass *klass)
 
        widget_class = GTK_WIDGET_CLASS (klass);
        widget_class->show = editor_table_dialog_show;
+       widget_class->hide = editor_table_dialog_hide;
 }
 
 static void
 e_editor_table_dialog_init (EEditorTableDialog *dialog)
 {
-       GtkBox *main_layout, *box;
-       GtkGrid *grid;
+       GtkGrid *main_layout, *grid;
        GtkWidget *widget;
        GtkFileFilter *file_filter;
 
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_TABLE_DIALOG, EEditorTableDialogPrivate);
 
-       main_layout = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 5));
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        /* == General == */
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>General</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 1, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Rows */
@@ -635,6 +631,7 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->rows_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Rows:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->rows_edit);
        gtk_grid_attach (grid, widget, 1, 0, 1, 1);
 
@@ -651,6 +648,7 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->columns_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("C_olumns:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->columns_edit);
        gtk_grid_attach (grid, widget, 4, 0, 1, 1);
 
@@ -659,16 +657,17 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Layout</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 3, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Width */
-       widget = gtk_check_button_new_with_mnemonic (_("Width:"));
+       widget = gtk_check_button_new_with_mnemonic (_("_Width:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -702,6 +701,7 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->spacing_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Spacing:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->spacing_edit);
        gtk_grid_attach (grid, widget, 4, 0, 1, 1);
 
@@ -718,6 +718,7 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->padding_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Padding:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->padding_edit);
        gtk_grid_attach (grid, widget, 4, 1, 1, 1);
 
@@ -734,6 +735,7 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->border_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Border:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->border_edit);
        gtk_grid_attach (grid, widget, 4, 2, 1, 1);
 
@@ -752,6 +754,7 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->alignment_combo = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Alignment:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->alignment_combo);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
@@ -759,12 +762,12 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Background</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+       gtk_grid_attach (main_layout, widget, 0, 4, 1, 1);
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 5, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Color */
@@ -778,6 +781,7 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->background_color_button = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Color:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_color_button);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
@@ -804,22 +808,11 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
 
 
        widget =gtk_label_new_with_mnemonic (_("Image:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_image_button);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
-       /* == Button box == */
-       box = GTK_BOX (gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL));
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_END);
-       gtk_box_pack_start (main_layout, GTK_WIDGET (box), TRUE, TRUE, 0);
-
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (editor_table_dialog_close), dialog);
-       dialog->priv->close_button = widget;
-
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
diff --git a/e-util/e-editor-text-dialog.c b/e-util/e-editor-text-dialog.c
index 0563256..dd1756b 100644
--- a/e-util/e-editor-text-dialog.c
+++ b/e-util/e-editor-text-dialog.c
@@ -39,8 +39,6 @@ struct _EEditorTextDialogPrivate {
 
        GtkWidget *color_check;
        GtkWidget *size_check;
-
-       GtkWidget *close_button;
 };
 
 
@@ -204,17 +202,13 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                dialog, E_TYPE_EDITOR_TEXT_DIALOG, EEditorTextDialogPrivate);
 
-       main_layout = GTK_GRID (gtk_grid_new ());
-       gtk_grid_set_row_spacing (main_layout, 5);
-       gtk_grid_set_column_spacing (main_layout, 5);
-       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
 
        /* Bold */
        widget = gtk_image_new_from_stock (GTK_STOCK_BOLD, GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
-       widget = gtk_check_button_new_with_mnemonic (_("Bold"));
+       widget = gtk_check_button_new_with_mnemonic (_("_Bold"));
        gtk_grid_attach (main_layout, widget, 1, 0, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -225,7 +219,7 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        widget = gtk_image_new_from_stock (GTK_STOCK_ITALIC, GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (main_layout, widget, 0, 1, 1, 1);
 
-       widget = gtk_check_button_new_with_mnemonic (_("Italic"));
+       widget = gtk_check_button_new_with_mnemonic (_("_Italic"));
        gtk_grid_attach (main_layout, widget, 1, 1, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -236,7 +230,7 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        widget = gtk_image_new_from_stock (GTK_STOCK_UNDERLINE, GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
 
-       widget = gtk_check_button_new_with_mnemonic (_("Underline"));
+       widget = gtk_check_button_new_with_mnemonic (_("_Underline"));
        gtk_grid_attach (main_layout, widget, 1, 2, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -246,7 +240,7 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        widget = gtk_image_new_from_stock (GTK_STOCK_STRIKETHROUGH, GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (main_layout, widget, 0, 3, 1, 1);
 
-       widget = gtk_check_button_new_with_mnemonic (_("Strikethrough"));
+       widget = gtk_check_button_new_with_mnemonic (_("_Strikethrough"));
        gtk_grid_attach (main_layout, widget, 1, 3, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -261,7 +255,8 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
                G_CALLBACK (editor_text_dialog_set_color), dialog);
        dialog->priv->color_check = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Color:"));
+       widget = gtk_label_new_with_mnemonic (_("_Color:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->color_check);
        gtk_grid_attach (main_layout, widget, 2, 0, 1, 1);
 
@@ -280,23 +275,11 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
                G_CALLBACK (editor_text_dialog_set_size), dialog);
        dialog->priv->size_check = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("Size:"));
+       widget = gtk_label_new_with_mnemonic (_("Si_ze:"));
+       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->size_check);
        gtk_grid_attach (main_layout, widget, 2, 1, 1, 1);
 
-       /* Close button */
-       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       g_signal_connect_swapped (
-               widget, "clicked",
-               G_CALLBACK (gtk_widget_hide), dialog);
-       dialog->priv->close_button = widget;
-
-       widget = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_END);
-       gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
-       gtk_grid_attach (main_layout, widget, 0, 4, 4, 1);
-       gtk_box_pack_start (GTK_BOX (widget), dialog->priv->close_button, FALSE, FALSE, 5);
-
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]