[evolution] Bug 783987 - Mail account assistant/editor too tall for small resolution



commit f582dae7c0c43c4c998b6a7b1b6c635b9364c28c
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jun 20 18:56:33 2017 +0200

    Bug 783987 - Mail account assistant/editor too tall for small resolution

 src/e-util/e-misc-utils.c                          |  107 +++++++
 src/e-util/e-misc-utils.h                          |    4 +
 src/e-util/e-preferences-window.c                  |   45 +---
 src/mail/e-mail-config-activity-page.c             |   18 +-
 src/mail/e-mail-config-activity-page.h             |    6 +-
 src/mail/e-mail-config-assistant.c                 |   16 +
 src/mail/e-mail-config-confirm-page.c              |   16 +-
 src/mail/e-mail-config-confirm-page.h              |    4 +-
 src/mail/e-mail-config-defaults-page.c             |   15 +-
 src/mail/e-mail-config-identity-page.c             |   25 +-
 src/mail/e-mail-config-identity-page.h             |    4 +-
 src/mail/e-mail-config-lookup-page.c               |   18 +-
 src/mail/e-mail-config-lookup-page.h               |    4 +-
 src/mail/e-mail-config-page.c                      |   39 +++-
 src/mail/e-mail-config-page.h                      |    2 +
 src/mail/e-mail-config-provider-page.c             |   62 +++--
 src/mail/e-mail-config-security-page.c             |   16 +-
 src/mail/e-mail-config-security-page.h             |    4 +-
 src/mail/e-mail-config-service-page.c              |  294 ++++++++++----------
 src/mail/e-mail-config-summary-page.c              |   27 ++-
 src/mail/e-mail-config-summary-page.h              |    6 +-
 src/mail/e-mail-config-welcome-page.c              |   15 +-
 src/mail/e-mail-config-welcome-page.h              |    4 +-
 src/mail/e-mail-config-window.c                    |   16 +
 .../backup-restore/e-mail-config-restore-page.c    |   16 +-
 .../backup-restore/e-mail-config-restore-page.h    |    4 +-
 .../e-mail-config-restore-ready-page.c             |    2 +-
 .../e-mail-config-restore-ready-page.h             |    4 +-
 .../mail-config/e-mail-config-google-summary.c     |    6 +-
 .../mail-config/e-mail-config-yahoo-summary.c      |    6 +-
 .../startup-wizard/e-mail-config-import-page.c     |   14 +-
 .../startup-wizard/e-mail-config-import-page.h     |    4 +-
 .../e-mail-config-import-progress-page.c           |   18 +-
 .../e-mail-config-import-progress-page.h           |    4 +-
 34 files changed, 513 insertions(+), 332 deletions(-)
---
diff --git a/src/e-util/e-misc-utils.c b/src/e-util/e-misc-utils.c
index e5e7097..ea27449 100644
--- a/src/e-util/e-misc-utils.c
+++ b/src/e-util/e-misc-utils.c
@@ -3943,3 +3943,110 @@ e_util_next_uri_from_uri_list (guchar **uri_list,
 
        return (gchar *) uri;
 }
+
+/**
+ * e_util_resize_window_for_screen:
+ * @window: a #GtkWindow
+ * @window_width: the @window width without @children, or -1 to compute
+ * @window_height: the @window height without @children, or -1 to compute
+ * @children: (element-type GtkWidget): (nullable): a #GSList with children to calculate with
+ *
+ * Calculates the size of the @window considering preferred sizes of @children,
+ * and shrinks the @window in case it won't be completely visible on the screen
+ * it is assigned to.
+ *
+ * Since: 3.26
+ **/
+void
+e_util_resize_window_for_screen (GtkWindow *window,
+                                gint window_width,
+                                gint window_height,
+                                const GSList *children)
+{
+       gint width = -1, height = -1, content_width = -1, content_height = -1, current_width = -1, 
current_height = -1;
+       GtkRequisition requisition;
+       const GSList *link;
+
+       g_return_if_fail (GTK_IS_WINDOW (window));
+
+       gtk_window_get_default_size (window, &width, &height);
+       if (width < 0 || height < 0) {
+               gtk_widget_get_preferred_size (GTK_WIDGET (window), &requisition, NULL);
+
+               width = requisition.width;
+               height = requisition.height;
+       }
+
+       for (link = children; link; link = g_slist_next (link)) {
+               GtkWidget *widget = link->data;
+
+               if (GTK_IS_SCROLLED_WINDOW (widget))
+                       widget = gtk_bin_get_child (GTK_BIN (widget));
+
+               if (GTK_IS_VIEWPORT (widget))
+                       widget = gtk_bin_get_child (GTK_BIN (widget));
+
+               if (!GTK_IS_WIDGET (widget))
+                       continue;
+
+               gtk_widget_get_preferred_size (widget, &requisition, NULL);
+
+               if (requisition.width > content_width)
+                       content_width = requisition.width;
+               if (requisition.height > content_height)
+                       content_height = requisition.height;
+
+               widget = gtk_widget_get_parent (widget);
+               if (GTK_IS_VIEWPORT (widget))
+                       widget = gtk_widget_get_parent (widget);
+
+               if (GTK_IS_WIDGET (widget)) {
+                       gtk_widget_get_preferred_size (widget, &requisition, NULL);
+
+                       if (current_width == -1 || current_width < requisition.width)
+                               current_width = requisition.width;
+                       if (current_height == -1 || current_height < requisition.height)
+                               current_height = requisition.height;
+               }
+       }
+
+       if (content_width > 0 && content_height > 0 && width > 0 && height > 0) {
+               GdkScreen *screen;
+               GdkRectangle monitor_area;
+               gint x = 0, y = 0, monitor;
+
+               screen = gtk_window_get_screen (GTK_WINDOW (window));
+               gtk_window_get_position (GTK_WINDOW (window), &x, &y);
+
+               monitor = gdk_screen_get_monitor_at_point (screen, x, y);
+               if (monitor < 0 || monitor >= gdk_screen_get_n_monitors (screen))
+                       monitor = 0;
+
+               gdk_screen_get_monitor_workarea (screen, monitor, &monitor_area);
+
+               /* When the children are packed inside the window then influence the window
+                  size too, thus subtract it, if possible. */
+               if (window_width < 0) {
+                       if (current_width > 0 && current_width < width)
+                               width -= current_width;
+               } else {
+                       width = window_width;
+               }
+
+               if (window_height < 0) {
+                       if (current_height > 0 && current_height < height)
+                               height -= current_height;
+               } else {
+                       height = window_height;
+               }
+
+               if (content_width > monitor_area.width - width)
+                       content_width = monitor_area.width - width;
+
+               if (content_height > monitor_area.height - height)
+                       content_height = monitor_area.height - height;
+
+               if (content_width > 0 && content_height > 0)
+                       gtk_window_set_default_size (GTK_WINDOW (window), width + content_width, height + 
content_height);
+       }
+}
diff --git a/src/e-util/e-misc-utils.h b/src/e-util/e-misc-utils.h
index 65d15fe..270af86 100644
--- a/src/e-util/e-misc-utils.h
+++ b/src/e-util/e-misc-utils.h
@@ -335,6 +335,10 @@ gboolean   e_util_get_webkit_developer_mode_enabled
 gchar *                e_util_next_uri_from_uri_list   (guchar **uri_list,
                                                 gint *len,
                                                 gint *list_len);
+void           e_util_resize_window_for_screen (GtkWindow *window,
+                                                gint window_width,
+                                                gint window_height,
+                                                const GSList *children); /* GtkWidget * */
 
 G_END_DECLS
 
diff --git a/src/e-util/e-preferences-window.c b/src/e-util/e-preferences-window.c
index 1bebeb6..47961e6 100644
--- a/src/e-util/e-preferences-window.c
+++ b/src/e-util/e-preferences-window.c
@@ -521,9 +521,8 @@ e_preferences_window_setup (EPreferencesWindow *window)
 {
        gint i, num;
        GtkNotebook *notebook;
-       GtkRequisition requisition;
-       gint width = -1, height = -1, content_width = -1, content_height = -1;
        EPreferencesWindowPrivate *priv;
+       GSList *children = NULL;
 
        g_return_if_fail (E_IS_PREFERENCES_WINDOW (window));
 
@@ -532,14 +531,6 @@ e_preferences_window_setup (EPreferencesWindow *window)
        if (priv->setup)
                return;
 
-       gtk_window_get_default_size (GTK_WINDOW (window), &width, &height);
-       if (width < 0 || height < 0) {
-               gtk_widget_get_preferred_size (GTK_WIDGET (window), &requisition, NULL);
-
-               width = requisition.width;
-               height = requisition.height;
-       }
-
        notebook = GTK_NOTEBOOK (priv->notebook);
        num = gtk_notebook_get_n_pages (notebook);
 
@@ -558,6 +549,8 @@ e_preferences_window_setup (EPreferencesWindow *window)
                if (content) {
                        GtkScrolledWindow *scrolled;
 
+                       children = g_slist_prepend (children, content);
+
                        scrolled = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
                        gtk_scrolled_window_add_with_viewport (scrolled, content);
                        gtk_scrolled_window_set_min_content_width (scrolled, 320);
@@ -570,43 +563,15 @@ e_preferences_window_setup (EPreferencesWindow *window)
                                GTK_SHADOW_NONE);
 
                        gtk_widget_show (content);
-
-                       gtk_widget_get_preferred_size (GTK_WIDGET (content), &requisition, NULL);
-
-                       if (requisition.width > content_width)
-                               content_width = requisition.width;
-                       if (requisition.height > content_height)
-                               content_height = requisition.height;
-
                        gtk_widget_show (GTK_WIDGET (scrolled));
 
                        gtk_container_add (GTK_CONTAINER (align), GTK_WIDGET (scrolled));
                }
        }
 
-       if (content_width > 0 && content_height > 0 && width > 0 && height > 0) {
-               GdkScreen *screen;
-               GdkRectangle monitor_area;
-               gint x = 0, y = 0, monitor;
+       e_util_resize_window_for_screen (GTK_WINDOW (window), -1, -1, children);
 
-               screen = gtk_window_get_screen (GTK_WINDOW (window));
-               gtk_window_get_position (GTK_WINDOW (window), &x, &y);
-
-               monitor = gdk_screen_get_monitor_at_point (screen, x, y);
-               if (monitor < 0 || monitor >= gdk_screen_get_n_monitors (screen))
-                       monitor = 0;
-
-               gdk_screen_get_monitor_workarea (screen, monitor, &monitor_area);
-
-               if (content_width > monitor_area.width - width)
-                       content_width = monitor_area.width - width;
-
-               if (content_height > monitor_area.height - height)
-                       content_height = monitor_area.height - height;
-
-               if (content_width > 0 && content_height > 0)
-                       gtk_window_set_default_size (GTK_WINDOW (window), width + content_width, height + 
content_height);
-       }
+       g_slist_free (children);
 
        priv->setup = TRUE;
 }
diff --git a/src/mail/e-mail-config-activity-page.c b/src/mail/e-mail-config-activity-page.c
index 37a0ee7..75f0362 100644
--- a/src/mail/e-mail-config-activity-page.c
+++ b/src/mail/e-mail-config-activity-page.c
@@ -24,6 +24,7 @@
        ((obj), E_TYPE_MAIL_CONFIG_ACTIVITY_PAGE, EMailConfigActivityPagePrivate))
 
 struct _EMailConfigActivityPagePrivate {
+       GtkWidget *box;                 /* not referenced */
        GtkWidget *activity_bar;        /* not referenced */
        GtkWidget *alert_bar;           /* not referenced */
 };
@@ -35,7 +36,7 @@ static void   e_mail_config_activity_page_alert_sink_init
 G_DEFINE_ABSTRACT_TYPE_WITH_CODE (
        EMailConfigActivityPage,
        e_mail_config_activity_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        G_IMPLEMENT_INTERFACE (
                E_TYPE_ALERT_SINK,
                e_mail_config_activity_page_alert_sink_init))
@@ -52,15 +53,14 @@ mail_config_activity_page_constructed (GObject *object)
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_activity_page_parent_class)->constructed (object);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
+       page->priv->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 
        /* Does not matter what order the EActivityBar and EAlertBar are
         * packed.  They should never both be visible at the same time. */
 
        frame = gtk_frame_new (NULL);
        gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-       gtk_box_pack_end (GTK_BOX (page), frame, FALSE, FALSE, 0);
+       gtk_box_pack_end (GTK_BOX (page->priv->box), frame, FALSE, FALSE, 0);
        /* Visibility is bound to the EActivityBar. */
 
        widget = e_activity_bar_new ();
@@ -75,7 +75,7 @@ mail_config_activity_page_constructed (GObject *object)
 
        frame = gtk_frame_new (NULL);
        gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-       gtk_box_pack_end (GTK_BOX (page), frame, FALSE, FALSE, 0);
+       gtk_box_pack_end (GTK_BOX (page->priv->box), frame, FALSE, FALSE, 0);
        /* Visibility is bound to the EAlertBar. */
 
        widget = e_alert_bar_new ();
@@ -143,6 +143,14 @@ e_mail_config_activity_page_init (EMailConfigActivityPage *page)
        page->priv = E_MAIL_CONFIG_ACTIVITY_PAGE_GET_PRIVATE (page);
 }
 
+GtkWidget *
+e_mail_config_activity_page_get_internal_box (EMailConfigActivityPage *page)
+{
+       g_return_val_if_fail (E_IS_MAIL_CONFIG_ACTIVITY_PAGE (page), NULL);
+
+       return page->priv->box;
+}
+
 EActivity *
 e_mail_config_activity_page_new_activity (EMailConfigActivityPage *page)
 {
diff --git a/src/mail/e-mail-config-activity-page.h b/src/mail/e-mail-config-activity-page.h
index a1b7e39..7366d6d 100644
--- a/src/mail/e-mail-config-activity-page.h
+++ b/src/mail/e-mail-config-activity-page.h
@@ -52,16 +52,18 @@ typedef struct _EMailConfigActivityPageClass EMailConfigActivityPageClass;
 typedef struct _EMailConfigActivityPagePrivate EMailConfigActivityPagePrivate;
 
 struct _EMailConfigActivityPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigActivityPagePrivate *priv;
 };
 
 struct _EMailConfigActivityPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_activity_page_get_type
                                                (void) G_GNUC_CONST;
+GtkWidget *    e_mail_config_activity_page_get_internal_box
+                                               (EMailConfigActivityPage *page);
 EActivity *    e_mail_config_activity_page_new_activity
                                                (EMailConfigActivityPage *page);
 
diff --git a/src/mail/e-mail-config-assistant.c b/src/mail/e-mail-config-assistant.c
index 6240bdc..c6b0027 100644
--- a/src/mail/e-mail-config-assistant.c
+++ b/src/mail/e-mail-config-assistant.c
@@ -652,6 +652,9 @@ mail_config_assistant_constructed (GObject *object)
        GList *list, *link;
        const gchar *extension_name;
        const gchar *title;
+       GtkRequisition requisition;
+       GSList *children = NULL;
+       gint ii, npages;
 
        assistant = E_MAIL_CONFIG_ASSISTANT (object);
 
@@ -711,6 +714,10 @@ mail_config_assistant_constructed (GObject *object)
                e_mail_session_get_local_folder_uri (
                session, E_MAIL_LOCAL_FOLDER_SENT));
 
+       gtk_widget_get_preferred_size (GTK_WIDGET (assistant), &requisition, NULL);
+       requisition.width += 2 * 12;
+       requisition.height += 2 * 12;
+
        /*** Welcome Page ***/
 
        page = e_mail_config_welcome_page_new ();
@@ -906,6 +913,15 @@ mail_config_assistant_constructed (GObject *object)
        e_mail_config_assistant_add_page (assistant, page);
 
        e_extensible_load_extensions (E_EXTENSIBLE (assistant));
+
+       npages = gtk_assistant_get_n_pages (GTK_ASSISTANT (assistant));
+       for (ii = 0; ii < npages; ii++) {
+               children = g_slist_prepend (children, gtk_assistant_get_nth_page (GTK_ASSISTANT (assistant), 
ii));
+       }
+
+       e_util_resize_window_for_screen (GTK_WINDOW (assistant), requisition.width, requisition.height, 
children);
+
+       g_slist_free (children);
 }
 
 static void
diff --git a/src/mail/e-mail-config-confirm-page.c b/src/mail/e-mail-config-confirm-page.c
index 0a7edd2..ad32e73 100644
--- a/src/mail/e-mail-config-confirm-page.c
+++ b/src/mail/e-mail-config-confirm-page.c
@@ -43,7 +43,7 @@ static void   e_mail_config_confirm_page_interface_init
 G_DEFINE_TYPE_WITH_CODE (
        EMailConfigConfirmPage,
        e_mail_config_confirm_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        G_IMPLEMENT_INTERFACE (
                E_TYPE_EXTENSIBLE, NULL)
        G_IMPLEMENT_INTERFACE (
@@ -103,24 +103,20 @@ static void
 mail_config_confirm_page_constructed (GObject *object)
 {
        EMailConfigConfirmPage *page;
-       GtkWidget *widget;
+       GtkWidget *main_box, *widget;
 
        page = E_MAIL_CONFIG_CONFIRM_PAGE (object);
 
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_confirm_page_parent_class)->constructed (object);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
-
-       gtk_box_set_spacing (GTK_BOX (page), 12);
-
-       gtk_widget_set_valign (GTK_WIDGET (page), GTK_ALIGN_CENTER);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+       gtk_widget_set_valign (main_box, GTK_ALIGN_CENTER);
 
        widget = gtk_label_new (NULL);
        gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        e_binding_bind_property (
@@ -129,6 +125,8 @@ mail_config_confirm_page_constructed (GObject *object)
                G_BINDING_BIDIRECTIONAL |
                G_BINDING_SYNC_CREATE);
 
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
+
        e_extensible_load_extensions (E_EXTENSIBLE (page));
 }
 
diff --git a/src/mail/e-mail-config-confirm-page.h b/src/mail/e-mail-config-confirm-page.h
index 8d07a71..8a64824 100644
--- a/src/mail/e-mail-config-confirm-page.h
+++ b/src/mail/e-mail-config-confirm-page.h
@@ -50,12 +50,12 @@ typedef struct _EMailConfigConfirmPageClass EMailConfigConfirmPageClass;
 typedef struct _EMailConfigConfirmPagePrivate EMailConfigConfirmPagePrivate;
 
 struct _EMailConfigConfirmPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigConfirmPagePrivate *priv;
 };
 
 struct _EMailConfigConfirmPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_confirm_page_get_type
diff --git a/src/mail/e-mail-config-defaults-page.c b/src/mail/e-mail-config-defaults-page.c
index c9f0842..39ebfeb 100644
--- a/src/mail/e-mail-config-defaults-page.c
+++ b/src/mail/e-mail-config-defaults-page.c
@@ -776,7 +776,7 @@ mail_config_defaults_page_constructed (GObject *object)
        GtkButton *button;
        GtkWidget *widget;
        GtkWidget *container;
-       GtkWidget *hbox;
+       GtkWidget *hbox, *main_box;
        GtkSizeGroup *size_group;
        GEnumClass *enum_class;
        GEnumValue *enum_value;
@@ -810,10 +810,9 @@ mail_config_defaults_page_constructed (GObject *object)
        extension_name = E_SOURCE_EXTENSION_MDN;
        mdn_ext = e_source_get_extension (source, extension_name);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
+       main_box = e_mail_config_activity_page_get_internal_box (E_MAIL_CONFIG_ACTIVITY_PAGE (page));
 
-       gtk_box_set_spacing (GTK_BOX (page), 12);
+       gtk_box_set_spacing (GTK_BOX (main_box), 12);
 
        size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
@@ -822,7 +821,7 @@ mail_config_defaults_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -1020,7 +1019,7 @@ mail_config_defaults_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -1121,7 +1120,7 @@ mail_config_defaults_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -1186,6 +1185,8 @@ mail_config_defaults_page_constructed (GObject *object)
 
        g_object_unref (size_group);
 
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
+
        e_extensible_load_extensions (E_EXTENSIBLE (page));
 }
 
diff --git a/src/mail/e-mail-config-identity-page.c b/src/mail/e-mail-config-identity-page.c
index 93e20aa..90b2ca3 100644
--- a/src/mail/e-mail-config-identity-page.c
+++ b/src/mail/e-mail-config-identity-page.c
@@ -65,7 +65,7 @@ static void   e_mail_config_identity_page_interface_init
 G_DEFINE_TYPE_WITH_CODE (
        EMailConfigIdentityPage,
        e_mail_config_identity_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        G_IMPLEMENT_INTERFACE (
                E_TYPE_EXTENSIBLE, NULL)
        G_IMPLEMENT_INTERFACE (
@@ -485,7 +485,7 @@ mail_config_identity_page_constructed (GObject *object)
        GtkTreeModel *model;
        GtkTreeSelection *selection;
        GtkCellRenderer *renderer;
-       GtkWidget *widget;
+       GtkWidget *main_box, *widget;
        GtkWidget *container;
        GtkWidget *scrolledwindow;
        GtkSizeGroup *size_group;
@@ -503,12 +503,9 @@ mail_config_identity_page_constructed (GObject *object)
        source = e_mail_config_identity_page_get_identity_source (page);
        extension = e_source_get_extension (source, extension_name);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
-
-       gtk_box_set_spacing (GTK_BOX (page), 12);
-       gtk_widget_set_valign (GTK_WIDGET (page), GTK_ALIGN_FILL);
-       gtk_widget_set_vexpand (GTK_WIDGET (page), TRUE);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+       gtk_widget_set_valign (main_box, GTK_ALIGN_FILL);
+       gtk_widget_set_vexpand (main_box, TRUE);
 
        /* This keeps all mnemonic labels the same width. */
        size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -520,7 +517,7 @@ mail_config_identity_page_constructed (GObject *object)
        widget = gtk_label_new (text);
        gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
 
        e_binding_bind_property (
                page, "show-instructions",
@@ -532,7 +529,7 @@ mail_config_identity_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
 
        e_binding_bind_property (
                page, "show-account-info",
@@ -591,7 +588,7 @@ mail_config_identity_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -678,7 +675,7 @@ mail_config_identity_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -898,7 +895,9 @@ mail_config_identity_page_constructed (GObject *object)
 
        page->priv->autodiscover_check = widget;
 
-       gtk_container_add (GTK_CONTAINER (page), widget);
+       gtk_container_add (GTK_CONTAINER (main_box), widget);
+
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
 
        e_extensible_load_extensions (E_EXTENSIBLE (page));
 }
diff --git a/src/mail/e-mail-config-identity-page.h b/src/mail/e-mail-config-identity-page.h
index bfa9d9f..2677bc8 100644
--- a/src/mail/e-mail-config-identity-page.h
+++ b/src/mail/e-mail-config-identity-page.h
@@ -51,12 +51,12 @@ typedef struct _EMailConfigIdentityPageClass EMailConfigIdentityPageClass;
 typedef struct _EMailConfigIdentityPagePrivate EMailConfigIdentityPagePrivate;
 
 struct _EMailConfigIdentityPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigIdentityPagePrivate *priv;
 };
 
 struct _EMailConfigIdentityPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_identity_page_get_type
diff --git a/src/mail/e-mail-config-lookup-page.c b/src/mail/e-mail-config-lookup-page.c
index 9c0c21a..065bc6c 100644
--- a/src/mail/e-mail-config-lookup-page.c
+++ b/src/mail/e-mail-config-lookup-page.c
@@ -30,7 +30,7 @@ static void   e_mail_config_lookup_page_interface_init
 G_DEFINE_TYPE_WITH_CODE (
        EMailConfigLookupPage,
        e_mail_config_lookup_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        G_IMPLEMENT_INTERFACE (
                E_TYPE_MAIL_CONFIG_PAGE,
                e_mail_config_lookup_page_interface_init))
@@ -40,7 +40,7 @@ mail_config_lookup_page_constructed (GObject *object)
 {
        EMailConfigLookupPage *page;
        GtkWidget *container;
-       GtkWidget *widget;
+       GtkWidget *main_box, *widget;
        const gchar *text;
 
        page = E_MAIL_CONFIG_LOOKUP_PAGE (object);
@@ -48,15 +48,11 @@ mail_config_lookup_page_constructed (GObject *object)
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_lookup_page_parent_class)->constructed (object);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
-
-       gtk_box_set_spacing (GTK_BOX (page), 12);
-
-       gtk_widget_set_valign (GTK_WIDGET (page), GTK_ALIGN_FILL);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+       gtk_widget_set_valign (main_box, GTK_ALIGN_FILL);
 
        widget = gtk_alignment_new (0.5, 0.5, 0.5, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, TRUE, TRUE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -68,8 +64,10 @@ mail_config_lookup_page_constructed (GObject *object)
 
        text = _("Looking up account details...");
        widget = gtk_label_new (text);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
+
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
 }
 
 static gboolean
diff --git a/src/mail/e-mail-config-lookup-page.h b/src/mail/e-mail-config-lookup-page.h
index c8abc6e..c7b6ed7 100644
--- a/src/mail/e-mail-config-lookup-page.h
+++ b/src/mail/e-mail-config-lookup-page.h
@@ -53,12 +53,12 @@ typedef struct _EMailConfigLookupPageClass EMailConfigLookupPageClass;
 typedef struct _EMailConfigLookupPagePrivate EMailConfigLookupPagePrivate;
 
 struct _EMailConfigLookupPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigLookupPagePrivate *priv;
 };
 
 struct _EMailConfigLookupPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_lookup_page_get_type
diff --git a/src/mail/e-mail-config-page.c b/src/mail/e-mail-config-page.c
index c9795aa..161a637 100644
--- a/src/mail/e-mail-config-page.c
+++ b/src/mail/e-mail-config-page.c
@@ -36,10 +36,7 @@ enum {
 
 static gulong signals[LAST_SIGNAL];
 
-G_DEFINE_INTERFACE (
-       EMailConfigPage,
-       e_mail_config_page,
-       GTK_TYPE_WIDGET)
+G_DEFINE_INTERFACE (EMailConfigPage, e_mail_config_page, GTK_TYPE_SCROLLED_WINDOW)
 
 static gboolean
 mail_config_page_check_complete (EMailConfigPage *page)
@@ -170,6 +167,40 @@ e_mail_config_page_default_init (EMailConfigPageInterface *iface)
                G_TYPE_POINTER);
 }
 
+void
+e_mail_config_page_set_content (EMailConfigPage *page,
+                               GtkWidget *content)
+{
+       GtkScrolledWindow *scrolled;
+       GtkWidget *child;
+
+       g_return_if_fail (E_IS_MAIL_CONFIG_PAGE (page));
+       g_return_if_fail (!content || GTK_IS_WIDGET (content));
+
+       scrolled = GTK_SCROLLED_WINDOW (page);
+
+       if (content)
+               gtk_scrolled_window_add_with_viewport (scrolled, content);
+
+       gtk_scrolled_window_set_policy (scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+       gtk_scrolled_window_set_shadow_type (scrolled, GTK_SHADOW_NONE);
+
+       child = gtk_bin_get_child (GTK_BIN (scrolled));
+       if (GTK_IS_VIEWPORT (child))
+               gtk_viewport_set_shadow_type (GTK_VIEWPORT (child), GTK_SHADOW_OUT);
+
+       gtk_widget_show (content);
+
+       g_object_set (GTK_WIDGET (page),
+               "halign", GTK_ALIGN_FILL,
+               "hexpand", TRUE,
+               "valign", GTK_ALIGN_FILL,
+               "vexpand", TRUE,
+               NULL);
+
+       gtk_widget_show (GTK_WIDGET (page));
+}
+
 gint
 e_mail_config_page_compare (GtkWidget *page_a,
                             GtkWidget *page_b)
diff --git a/src/mail/e-mail-config-page.h b/src/mail/e-mail-config-page.h
index 35cb276..4e96e64 100644
--- a/src/mail/e-mail-config-page.h
+++ b/src/mail/e-mail-config-page.h
@@ -67,6 +67,8 @@ struct _EMailConfigPageInterface {
 };
 
 GType          e_mail_config_page_get_type     (void) G_GNUC_CONST;
+void           e_mail_config_page_set_content  (EMailConfigPage *page,
+                                                GtkWidget *content);
 gint           e_mail_config_page_compare      (GtkWidget *page_a,
                                                 GtkWidget *page_b);
 void           e_mail_config_page_changed      (EMailConfigPage *page);
diff --git a/src/mail/e-mail-config-provider-page.c b/src/mail/e-mail-config-provider-page.c
index 65cc1ec..4170757 100644
--- a/src/mail/e-mail-config-provider-page.c
+++ b/src/mail/e-mail-config-provider-page.c
@@ -89,6 +89,7 @@ mail_config_provider_page_handle_dependency (EMailConfigProviderPage *page,
 
 static void
 mail_config_provider_page_add_section (EMailConfigProviderPage *page,
+                                      GtkBox *main_box,
                                        CamelProviderConfEntry *entry)
 {
        EMailConfigServiceBackend *backend;
@@ -106,7 +107,7 @@ mail_config_provider_page_add_section (EMailConfigProviderPage *page,
        widget = gtk_label_new (markup);
        gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        /* Skip the top margin if this is the first entry. */
@@ -118,6 +119,7 @@ mail_config_provider_page_add_section (EMailConfigProviderPage *page,
 
 static void
 mail_config_provider_page_add_checkbox (EMailConfigProviderPage *page,
+                                       GtkBox *main_box,
                                         CamelProviderConfEntry *entry)
 {
        EMailConfigServiceBackend *backend;
@@ -131,7 +133,7 @@ mail_config_provider_page_add_checkbox (EMailConfigProviderPage *page,
 
        widget = gtk_check_button_new_with_mnemonic (entry->text);
        gtk_widget_set_margin_left (widget, STANDARD_MARGIN);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        e_binding_bind_property (
@@ -145,6 +147,7 @@ mail_config_provider_page_add_checkbox (EMailConfigProviderPage *page,
 
 static void
 mail_config_provider_page_add_checkspin (EMailConfigProviderPage *page,
+                                        GtkBox *main_box,
                                          CamelProviderConfEntry *entry)
 {
        EMailConfigServiceBackend *backend;
@@ -270,7 +273,7 @@ mail_config_provider_page_add_checkspin (EMailConfigProviderPage *page,
 
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
        gtk_widget_set_margin_left (hbox, STANDARD_MARGIN);
-       gtk_box_pack_start (GTK_BOX (page), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);
 
        if (use_pspec != NULL) {
@@ -315,6 +318,7 @@ mail_config_provider_page_add_checkspin (EMailConfigProviderPage *page,
 
 static void
 mail_config_provider_page_add_entry (EMailConfigProviderPage *page,
+                                    GtkBox *main_box,
                                      CamelProviderConfEntry *entry)
 {
        EMailConfigServiceBackend *backend;
@@ -331,7 +335,7 @@ mail_config_provider_page_add_entry (EMailConfigProviderPage *page,
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_box_set_spacing (GTK_BOX (hbox), 6);
        gtk_widget_set_margin_left (hbox, STANDARD_MARGIN);
-       gtk_box_pack_start (GTK_BOX (page), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);
 
        label = gtk_label_new_with_mnemonic (entry->text);
@@ -360,6 +364,7 @@ mail_config_provider_page_add_entry (EMailConfigProviderPage *page,
 
 static void
 mail_config_provider_page_add_label (EMailConfigProviderPage *page,
+                                    GtkBox *main_box,
                                     CamelProviderConfEntry *entry)
 {
        GtkWidget *hbox;
@@ -370,7 +375,7 @@ mail_config_provider_page_add_label (EMailConfigProviderPage *page,
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_box_set_spacing (GTK_BOX (hbox), 6);
        gtk_widget_set_margin_left (hbox, STANDARD_MARGIN);
-       gtk_box_pack_start (GTK_BOX (page), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);
 
        label = gtk_label_new (entry->text);
@@ -383,6 +388,7 @@ mail_config_provider_page_add_label (EMailConfigProviderPage *page,
 
 static void
 mail_config_provider_page_add_options (EMailConfigProviderPage *page,
+                                      GtkBox *main_box,
                                        CamelProviderConfEntry *entry)
 {
        EMailConfigServiceBackend *backend;
@@ -413,7 +419,7 @@ mail_config_provider_page_add_options (EMailConfigProviderPage *page,
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_box_set_spacing (GTK_BOX (hbox), 6);
        gtk_widget_set_margin_left (hbox, STANDARD_MARGIN);
-       gtk_box_pack_start (GTK_BOX (page), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);
 
        label = gtk_label_new_with_mnemonic (entry->text);
@@ -470,6 +476,7 @@ mail_config_provider_page_add_options (EMailConfigProviderPage *page,
 
 static void
 mail_config_provider_page_add_placeholder (EMailConfigProviderPage *page,
+                                          GtkBox *main_box,
                                           CamelProviderConfEntry *entry)
 {
        GtkWidget *hbox;
@@ -483,14 +490,15 @@ mail_config_provider_page_add_placeholder (EMailConfigProviderPage *page,
        gtk_widget_set_name (hbox, entry->name);
        gtk_box_set_spacing (GTK_BOX (hbox), 6);
        gtk_widget_set_margin_left (hbox, STANDARD_MARGIN);
-       gtk_box_pack_start (GTK_BOX (page), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);
 
        mail_config_provider_page_handle_dependency (page, entry, hbox);
 }
 
 static void
-mail_config_provider_page_add_widgets (EMailConfigProviderPage *page)
+mail_config_provider_page_add_widgets (EMailConfigProviderPage *page,
+                                      GtkBox *main_box)
 {
        EMailConfigServiceBackend *backend;
        CamelProviderConfEntry *entries;
@@ -531,13 +539,13 @@ mail_config_provider_page_add_widgets (EMailConfigProviderPage *page)
        widget = gtk_label_new (markup);
        gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
        g_free (markup);
 
        widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
        gtk_widget_set_margin_left (widget, STANDARD_MARGIN);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -592,37 +600,37 @@ mail_config_provider_page_add_widgets (EMailConfigProviderPage *page)
                                        continue;
                                }
                                mail_config_provider_page_add_section (
-                                       page, &entries[ii]);
+                                       page, main_box, &entries[ii]);
                                break;
 
                        case CAMEL_PROVIDER_CONF_CHECKBOX:
                                mail_config_provider_page_add_checkbox (
-                                       page, &entries[ii]);
+                                       page, main_box, &entries[ii]);
                                break;
 
                        case CAMEL_PROVIDER_CONF_CHECKSPIN:
                                mail_config_provider_page_add_checkspin (
-                                       page, &entries[ii]);
+                                       page, main_box, &entries[ii]);
                                break;
 
                        case CAMEL_PROVIDER_CONF_ENTRY:
                                mail_config_provider_page_add_entry (
-                                       page, &entries[ii]);
+                                       page, main_box, &entries[ii]);
                                break;
 
                        case CAMEL_PROVIDER_CONF_LABEL:
                                mail_config_provider_page_add_label (
-                                       page, &entries[ii]);
+                                       page, main_box, &entries[ii]);
                                break;
 
                        case CAMEL_PROVIDER_CONF_OPTIONS:
                                mail_config_provider_page_add_options (
-                                       page, &entries[ii]);
+                                       page, main_box, &entries[ii]);
                                break;
 
                        case CAMEL_PROVIDER_CONF_PLACEHOLDER:
                                mail_config_provider_page_add_placeholder (
-                                       page, &entries[ii]);
+                                       page, main_box, &entries[ii]);
                                break;
 
                        default:
@@ -699,25 +707,27 @@ mail_config_provider_page_constructed (GObject *object)
        EMailConfigProviderPage *page;
        EMailConfigServiceBackend *backend;
        CamelProvider *provider;
+       GtkWidget *main_box;
 
        page = E_MAIL_CONFIG_PROVIDER_PAGE (object);
 
        /* Chain up parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_provider_page_parent_class)->constructed (object);
 
-       gtk_box_set_spacing (GTK_BOX (object), 6);
+       main_box = e_mail_config_activity_page_get_internal_box (E_MAIL_CONFIG_ACTIVITY_PAGE (page));
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (object), GTK_ORIENTATION_VERTICAL);
+       gtk_box_set_spacing (GTK_BOX (main_box), 6);
 
        backend = e_mail_config_provider_page_get_backend (page);
        provider = e_mail_config_service_backend_get_provider (backend);
 
        if (provider != NULL && provider->extra_conf != NULL)
-               mail_config_provider_page_add_widgets (page);
+               mail_config_provider_page_add_widgets (page, GTK_BOX (main_box));
        else
                page->priv->is_empty = TRUE;
 
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
+
        e_extensible_load_extensions (E_EXTENSIBLE (page));
 }
 
@@ -815,6 +825,7 @@ e_mail_config_provider_page_get_placeholder (EMailConfigProviderPage *page,
                                             const gchar *name)
 {
        FindPlaceholderData fpd;
+       GtkWidget *widget;
 
        g_return_val_if_fail (E_IS_MAIL_CONFIG_PROVIDER_PAGE (page), NULL);
        g_return_val_if_fail (name && *name, NULL);
@@ -822,7 +833,14 @@ e_mail_config_provider_page_get_placeholder (EMailConfigProviderPage *page,
        fpd.name = name;
        fpd.box = NULL;
 
-       gtk_container_foreach (GTK_CONTAINER (page), mail_config_provider_page_find_placeholder, &fpd);
+       widget = gtk_bin_get_child (GTK_BIN (page));
+       if (GTK_IS_VIEWPORT (widget))
+               widget = gtk_bin_get_child (GTK_BIN (widget));
+
+       if (!GTK_IS_CONTAINER (widget))
+               return NULL;
+
+       gtk_container_foreach (GTK_CONTAINER (widget), mail_config_provider_page_find_placeholder, &fpd);
 
        return fpd.box;
 }
diff --git a/src/mail/e-mail-config-security-page.c b/src/mail/e-mail-config-security-page.c
index dc98ad5..971ea23 100644
--- a/src/mail/e-mail-config-security-page.c
+++ b/src/mail/e-mail-config-security-page.c
@@ -54,7 +54,7 @@ static void   e_mail_config_security_page_interface_init
 G_DEFINE_TYPE_WITH_CODE (
        EMailConfigSecurityPage,
        e_mail_config_security_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        G_IMPLEMENT_INTERFACE (
                E_TYPE_EXTENSIBLE, NULL)
        G_IMPLEMENT_INTERFACE (
@@ -273,6 +273,7 @@ mail_config_security_page_constructed (GObject *object)
        GtkLabel *label;
        GtkWidget *widget;
        GtkWidget *container;
+       GtkWidget *main_box;
        GtkSizeGroup *size_group;
        const gchar *extension_name;
        const gchar *text;
@@ -300,10 +301,7 @@ mail_config_security_page_constructed (GObject *object)
        smime_ext = e_source_get_extension (source, extension_name);
 #endif /* ENABLE_SMIME */
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
-
-       gtk_box_set_spacing (GTK_BOX (page), 12);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
 
        size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
@@ -312,7 +310,7 @@ mail_config_security_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -343,7 +341,7 @@ mail_config_security_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -498,7 +496,7 @@ mail_config_security_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -680,6 +678,8 @@ mail_config_security_page_constructed (GObject *object)
 
        g_object_unref (size_group);
 
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
+
        e_extensible_load_extensions (E_EXTENSIBLE (page));
 }
 
diff --git a/src/mail/e-mail-config-security-page.h b/src/mail/e-mail-config-security-page.h
index 038b9ac..8839180 100644
--- a/src/mail/e-mail-config-security-page.h
+++ b/src/mail/e-mail-config-security-page.h
@@ -51,12 +51,12 @@ typedef struct _EMailConfigSecurityPageClass EMailConfigSecurityPageClass;
 typedef struct _EMailConfigSecurityPagePrivate EMailConfigSecurityPagePrivate;
 
 struct _EMailConfigSecurityPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigSecurityPagePrivate *priv;
 };
 
 struct _EMailConfigSecurityPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_security_page_get_type
diff --git a/src/mail/e-mail-config-service-page.c b/src/mail/e-mail-config-service-page.c
index a3ed3ae..8338a8b 100644
--- a/src/mail/e-mail-config-service-page.c
+++ b/src/mail/e-mail-config-service-page.c
@@ -428,147 +428,6 @@ static void
 mail_config_service_page_constructed (GObject *object)
 {
        EMailConfigServicePage *page;
-
-       page = E_MAIL_CONFIG_SERVICE_PAGE (object);
-
-       /* Chain up to parent's constructed() method. */
-       G_OBJECT_CLASS (e_mail_config_service_page_parent_class)->constructed (object);
-
-       mail_config_service_page_init_backends (page);
-}
-
-static void
-mail_config_service_page_setup_defaults (EMailConfigPage *page)
-{
-       EMailConfigServicePageClass *class;
-       EMailConfigServicePagePrivate *priv;
-       guint ii;
-
-       class = E_MAIL_CONFIG_SERVICE_PAGE_GET_CLASS (page);
-       priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
-
-       for (ii = 0; ii < priv->candidates->len; ii++) {
-               Candidate *candidate;
-
-               candidate = priv->candidates->pdata[ii];
-               g_return_if_fail (candidate != NULL);
-
-               e_mail_config_service_backend_setup_defaults (
-                       candidate->backend);
-       }
-
-       /* XXX Not sure if we need to call setup_defaults() for
-        *     hidden candidates.  Hold off until a need arises. */
-
-       if (class->default_backend_name != NULL)
-               gtk_combo_box_set_active_id (
-                       GTK_COMBO_BOX (priv->type_combo),
-                       class->default_backend_name);
-}
-
-static gboolean
-mail_config_service_page_check_complete (EMailConfigPage *page)
-{
-       EMailConfigServicePagePrivate *priv;
-       EMailConfigServiceBackend *backend;
-       GtkComboBox *type_combo;
-       const gchar *backend_name;
-
-       priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
-
-       type_combo = GTK_COMBO_BOX (priv->type_combo);
-       backend_name = gtk_combo_box_get_active_id (type_combo);
-
-       if (backend_name == NULL)
-               return FALSE;
-
-       backend = e_mail_config_service_page_lookup_backend (
-               E_MAIL_CONFIG_SERVICE_PAGE (page), backend_name);
-
-       return e_mail_config_service_backend_check_complete (backend);
-}
-
-static void
-mail_config_service_page_commit_changes (EMailConfigPage *page,
-                                         GQueue *source_queue)
-{
-       EMailConfigServicePagePrivate *priv;
-       EMailConfigServiceBackend *backend;
-       GtkComboBox *type_combo;
-       const gchar *backend_name;
-
-       priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
-
-       type_combo = GTK_COMBO_BOX (priv->type_combo);
-       backend_name = gtk_combo_box_get_active_id (type_combo);
-       g_return_if_fail (backend_name != NULL);
-
-       backend = e_mail_config_service_page_lookup_backend (
-               E_MAIL_CONFIG_SERVICE_PAGE (page), backend_name);
-
-       e_mail_config_service_backend_commit_changes (backend);
-}
-
-static void
-e_mail_config_service_page_class_init (EMailConfigServicePageClass *class)
-{
-       GObjectClass *object_class;
-
-       g_type_class_add_private (class, sizeof (EMailConfigServicePagePrivate));
-
-       object_class = G_OBJECT_CLASS (class);
-       object_class->set_property = mail_config_service_page_set_property;
-       object_class->get_property = mail_config_service_page_get_property;
-       object_class->dispose = mail_config_service_page_dispose;
-       object_class->finalize = mail_config_service_page_finalize;
-       object_class->constructed = mail_config_service_page_constructed;
-
-       g_object_class_install_property (
-               object_class,
-               PROP_ACTIVE_BACKEND,
-               g_param_spec_object (
-                       "active-backend",
-                       "Active Backend",
-                       "The active service backend",
-                       E_TYPE_MAIL_CONFIG_SERVICE_BACKEND,
-                       G_PARAM_READWRITE |
-                       G_PARAM_STATIC_STRINGS));
-
-       g_object_class_install_property (
-               object_class,
-               PROP_EMAIL_ADDRESS,
-               g_param_spec_string (
-                       "email-address",
-                       "Email Address",
-                       "The user's email address",
-                       NULL,
-                       G_PARAM_READWRITE |
-                       G_PARAM_STATIC_STRINGS));
-
-       g_object_class_install_property (
-               object_class,
-               PROP_REGISTRY,
-               g_param_spec_object (
-                       "registry",
-                       "Registry",
-                       "Data source registry",
-                       E_TYPE_SOURCE_REGISTRY,
-                       G_PARAM_READWRITE |
-                       G_PARAM_CONSTRUCT_ONLY |
-                       G_PARAM_STATIC_STRINGS));
-}
-
-static void
-e_mail_config_service_page_interface_init (EMailConfigPageInterface *iface)
-{
-       iface->setup_defaults = mail_config_service_page_setup_defaults;
-       iface->check_complete = mail_config_service_page_check_complete;
-       iface->commit_changes = mail_config_service_page_commit_changes;
-}
-
-static void
-e_mail_config_service_page_init (EMailConfigServicePage *page)
-{
        GPtrArray *candidates;
        GPtrArray *hidden_candidates;
        PangoAttribute *attr;
@@ -576,9 +435,15 @@ e_mail_config_service_page_init (EMailConfigServicePage *page)
        GtkLabel *label;
        GtkWidget *widget;
        GtkWidget *container;
+       GtkWidget *main_box;
        GtkTreeModel *tree_model;
        GtkCellRenderer *renderer;
 
+       page = E_MAIL_CONFIG_SERVICE_PAGE (object);
+
+       /* Chain up to parent's constructed() method. */
+       G_OBJECT_CLASS (e_mail_config_service_page_parent_class)->constructed (object);
+
        /* The candidates array holds scratch ESources, one for each
         * item in the "type" combo box.  Scratch ESources are never
         * added to the registry, so backend extensions can make any
@@ -597,9 +462,9 @@ e_mail_config_service_page_init (EMailConfigServicePage *page)
        hidden_candidates = g_ptr_array_new_with_free_func (
                (GDestroyNotify) mail_config_service_page_free_candidate);
 
-       gtk_box_set_spacing (GTK_BOX (page), 12);
+       main_box = e_mail_config_activity_page_get_internal_box (E_MAIL_CONFIG_ACTIVITY_PAGE (page));
+       gtk_box_set_spacing (GTK_BOX (main_box), 12);
 
-       page->priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
        page->priv->candidates = candidates;
        page->priv->hidden_candidates = hidden_candidates;
 
@@ -622,7 +487,7 @@ e_mail_config_service_page_init (EMailConfigServicePage *page)
         * But we create both widgets and keep them both up-to-date
         * regardless just because it makes the logic simpler. */
 
-       container = GTK_WIDGET (page);
+       container = GTK_WIDGET (main_box);
 
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 12);
@@ -683,7 +548,7 @@ e_mail_config_service_page_init (EMailConfigServicePage *page)
 
        pango_attr_list_unref (attr_list);
 
-       container = GTK_WIDGET (page);
+       container = GTK_WIDGET (main_box);
 
        widget = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
        gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
@@ -736,6 +601,145 @@ e_mail_config_service_page_init (EMailConfigServicePage *page)
                G_CALLBACK (e_mail_config_page_changed), page);
 
        g_object_unref (tree_model);
+
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
+
+       mail_config_service_page_init_backends (page);
+}
+
+static void
+mail_config_service_page_setup_defaults (EMailConfigPage *page)
+{
+       EMailConfigServicePageClass *class;
+       EMailConfigServicePagePrivate *priv;
+       guint ii;
+
+       class = E_MAIL_CONFIG_SERVICE_PAGE_GET_CLASS (page);
+       priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
+
+       for (ii = 0; ii < priv->candidates->len; ii++) {
+               Candidate *candidate;
+
+               candidate = priv->candidates->pdata[ii];
+               g_return_if_fail (candidate != NULL);
+
+               e_mail_config_service_backend_setup_defaults (
+                       candidate->backend);
+       }
+
+       /* XXX Not sure if we need to call setup_defaults() for
+        *     hidden candidates.  Hold off until a need arises. */
+
+       if (class->default_backend_name != NULL)
+               gtk_combo_box_set_active_id (
+                       GTK_COMBO_BOX (priv->type_combo),
+                       class->default_backend_name);
+}
+
+static gboolean
+mail_config_service_page_check_complete (EMailConfigPage *page)
+{
+       EMailConfigServicePagePrivate *priv;
+       EMailConfigServiceBackend *backend;
+       GtkComboBox *type_combo;
+       const gchar *backend_name;
+
+       priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
+
+       type_combo = GTK_COMBO_BOX (priv->type_combo);
+       backend_name = gtk_combo_box_get_active_id (type_combo);
+
+       if (backend_name == NULL)
+               return FALSE;
+
+       backend = e_mail_config_service_page_lookup_backend (
+               E_MAIL_CONFIG_SERVICE_PAGE (page), backend_name);
+
+       return e_mail_config_service_backend_check_complete (backend);
+}
+
+static void
+mail_config_service_page_commit_changes (EMailConfigPage *page,
+                                         GQueue *source_queue)
+{
+       EMailConfigServicePagePrivate *priv;
+       EMailConfigServiceBackend *backend;
+       GtkComboBox *type_combo;
+       const gchar *backend_name;
+
+       priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
+
+       type_combo = GTK_COMBO_BOX (priv->type_combo);
+       backend_name = gtk_combo_box_get_active_id (type_combo);
+       g_return_if_fail (backend_name != NULL);
+
+       backend = e_mail_config_service_page_lookup_backend (
+               E_MAIL_CONFIG_SERVICE_PAGE (page), backend_name);
+
+       e_mail_config_service_backend_commit_changes (backend);
+}
+
+static void
+e_mail_config_service_page_class_init (EMailConfigServicePageClass *class)
+{
+       GObjectClass *object_class;
+
+       g_type_class_add_private (class, sizeof (EMailConfigServicePagePrivate));
+
+       object_class = G_OBJECT_CLASS (class);
+       object_class->set_property = mail_config_service_page_set_property;
+       object_class->get_property = mail_config_service_page_get_property;
+       object_class->dispose = mail_config_service_page_dispose;
+       object_class->finalize = mail_config_service_page_finalize;
+       object_class->constructed = mail_config_service_page_constructed;
+
+       g_object_class_install_property (
+               object_class,
+               PROP_ACTIVE_BACKEND,
+               g_param_spec_object (
+                       "active-backend",
+                       "Active Backend",
+                       "The active service backend",
+                       E_TYPE_MAIL_CONFIG_SERVICE_BACKEND,
+                       G_PARAM_READWRITE |
+                       G_PARAM_STATIC_STRINGS));
+
+       g_object_class_install_property (
+               object_class,
+               PROP_EMAIL_ADDRESS,
+               g_param_spec_string (
+                       "email-address",
+                       "Email Address",
+                       "The user's email address",
+                       NULL,
+                       G_PARAM_READWRITE |
+                       G_PARAM_STATIC_STRINGS));
+
+       g_object_class_install_property (
+               object_class,
+               PROP_REGISTRY,
+               g_param_spec_object (
+                       "registry",
+                       "Registry",
+                       "Data source registry",
+                       E_TYPE_SOURCE_REGISTRY,
+                       G_PARAM_READWRITE |
+                       G_PARAM_CONSTRUCT_ONLY |
+                       G_PARAM_STATIC_STRINGS));
+}
+
+static void
+e_mail_config_service_page_interface_init (EMailConfigPageInterface *iface)
+{
+       iface->setup_defaults = mail_config_service_page_setup_defaults;
+       iface->check_complete = mail_config_service_page_check_complete;
+       iface->commit_changes = mail_config_service_page_commit_changes;
+}
+
+static void
+e_mail_config_service_page_init (EMailConfigServicePage *page)
+{
+       page->priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
 }
 
 EMailConfigServiceBackend *
diff --git a/src/mail/e-mail-config-summary-page.c b/src/mail/e-mail-config-summary-page.c
index c4eff64..e02df1b 100644
--- a/src/mail/e-mail-config-summary-page.c
+++ b/src/mail/e-mail-config-summary-page.c
@@ -41,6 +41,7 @@ struct _EMailConfigSummaryPagePrivate {
        gulong transport_source_changed_id;
 
        /* Widgets (not referenced) */
+       GtkBox *main_box;
        GtkLabel *name_label;
        GtkLabel *address_label;
        GtkLabel *recv_backend_label;
@@ -77,7 +78,7 @@ static void   e_mail_config_summary_page_interface_init
 G_DEFINE_TYPE_WITH_CODE (
        EMailConfigSummaryPage,
        e_mail_config_summary_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        G_IMPLEMENT_INTERFACE (
                E_TYPE_EXTENSIBLE, NULL)
        G_IMPLEMENT_INTERFACE (
@@ -286,6 +287,7 @@ mail_config_summary_page_constructed (GObject *object)
        GtkLabel *label;
        GtkWidget *widget;
        GtkWidget *container;
+       GtkWidget *main_box;
        GtkSizeGroup *size_group;
        const gchar *text;
        gchar *markup;
@@ -295,12 +297,9 @@ mail_config_summary_page_constructed (GObject *object)
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_summary_page_parent_class)->constructed (object);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
-
        /* This page is dense with information,
         * so put extra space between sections. */
-       gtk_box_set_spacing (GTK_BOX (page), 24);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
 
        size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
@@ -308,7 +307,7 @@ mail_config_summary_page_constructed (GObject *object)
                 "to access your mail.");
        widget = gtk_label_new (text);
        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        /*** Account Information ***/
@@ -316,7 +315,7 @@ mail_config_summary_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -363,7 +362,7 @@ mail_config_summary_page_constructed (GObject *object)
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 12);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -515,6 +514,10 @@ mail_config_summary_page_constructed (GObject *object)
 
        g_object_unref (size_group);
 
+       page->priv->main_box = GTK_BOX (main_box);
+
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
+
        e_extensible_load_extensions (E_EXTENSIBLE (page));
 }
 
@@ -803,6 +806,14 @@ e_mail_config_summary_page_new (void)
        return g_object_new (E_TYPE_MAIL_CONFIG_SUMMARY_PAGE, NULL);
 }
 
+GtkBox *
+e_mail_config_summary_page_get_internal_box (EMailConfigSummaryPage *page)
+{
+       g_return_val_if_fail (E_IS_MAIL_CONFIG_SUMMARY_PAGE (page), NULL);
+
+       return page->priv->main_box;
+}
+
 void
 e_mail_config_summary_page_refresh (EMailConfigSummaryPage *page)
 {
diff --git a/src/mail/e-mail-config-summary-page.h b/src/mail/e-mail-config-summary-page.h
index ff301c5..af793dc 100644
--- a/src/mail/e-mail-config-summary-page.h
+++ b/src/mail/e-mail-config-summary-page.h
@@ -51,12 +51,12 @@ typedef struct _EMailConfigSummaryPageClass EMailConfigSummaryPageClass;
 typedef struct _EMailConfigSummaryPagePrivate EMailConfigSummaryPagePrivate;
 
 struct _EMailConfigSummaryPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigSummaryPagePrivate *priv;
 };
 
 struct _EMailConfigSummaryPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 
        /* Signals */
        void            (*refresh)              (EMailConfigSummaryPage *page);
@@ -66,6 +66,8 @@ GType         e_mail_config_summary_page_get_type
                                                (void) G_GNUC_CONST;
 EMailConfigPage *
                e_mail_config_summary_page_new  (void);
+GtkBox *       e_mail_config_summary_page_get_internal_box
+                                               (EMailConfigSummaryPage *page);
 void           e_mail_config_summary_page_refresh
                                                (EMailConfigSummaryPage *page);
 EMailConfigServiceBackend *
diff --git a/src/mail/e-mail-config-welcome-page.c b/src/mail/e-mail-config-welcome-page.c
index 98c4dfb..5efc818 100644
--- a/src/mail/e-mail-config-welcome-page.c
+++ b/src/mail/e-mail-config-welcome-page.c
@@ -44,7 +44,7 @@ static void   e_mail_config_welcome_page_interface_init
 G_DEFINE_TYPE_WITH_CODE (
        EMailConfigWelcomePage,
        e_mail_config_welcome_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        G_IMPLEMENT_INTERFACE (
                E_TYPE_EXTENSIBLE, NULL)
        G_IMPLEMENT_INTERFACE (
@@ -105,23 +105,20 @@ mail_config_welcome_page_constructed (GObject *object)
 {
        EMailConfigWelcomePage *page;
        GtkWidget *widget;
+       GtkWidget *main_box;
 
        page = E_MAIL_CONFIG_WELCOME_PAGE (object);
 
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_welcome_page_parent_class)->constructed (object);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
-
-       gtk_box_set_spacing (GTK_BOX (page), 12);
-
-       gtk_widget_set_valign (GTK_WIDGET (page), GTK_ALIGN_CENTER);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+       gtk_widget_set_valign (GTK_WIDGET (main_box), GTK_ALIGN_CENTER);
 
        widget = gtk_label_new (NULL);
        gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        e_binding_bind_object_text_property (
@@ -130,6 +127,8 @@ mail_config_welcome_page_constructed (GObject *object)
                G_BINDING_BIDIRECTIONAL |
                G_BINDING_SYNC_CREATE);
 
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
+
        e_extensible_load_extensions (E_EXTENSIBLE (page));
 }
 
diff --git a/src/mail/e-mail-config-welcome-page.h b/src/mail/e-mail-config-welcome-page.h
index 3155479..9766db3 100644
--- a/src/mail/e-mail-config-welcome-page.h
+++ b/src/mail/e-mail-config-welcome-page.h
@@ -50,12 +50,12 @@ typedef struct _EMailConfigWelcomePageClass EMailConfigWelcomePageClass;
 typedef struct _EMailConfigWelcomePagePrivate EMailConfigWelcomePagePrivate;
 
 struct _EMailConfigWelcomePage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigWelcomePagePrivate *priv;
 };
 
 struct _EMailConfigWelcomePageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_welcome_page_get_type
diff --git a/src/mail/e-mail-config-window.c b/src/mail/e-mail-config-window.c
index 5727ea2..2b1b0fa 100644
--- a/src/mail/e-mail-config-window.c
+++ b/src/mail/e-mail-config-window.c
@@ -314,6 +314,9 @@ mail_config_window_constructed (GObject *object)
        EMailConfigWindow *window;
        GtkWidget *container;
        GtkWidget *widget;
+       GSList *children = NULL;
+       gint ii, npages;
+       GtkRequisition requisition;
 
        window = E_MAIL_CONFIG_WINDOW (object);
 
@@ -347,6 +350,9 @@ mail_config_window_constructed (GObject *object)
        window->priv->alert_bar = widget;  /* not referenced */
        /* EAlertBar controls its own visibility. */
 
+       gtk_widget_get_preferred_size (GTK_WIDGET (window), &requisition, NULL);
+       requisition.width += 12 + 5; /* column spacing + border width of the grid*/
+
        /* Add an extra-wide margin to the left and bottom.
         *
         * XXX The bottom margin is tricky.  We want a 24px margin between
@@ -365,6 +371,7 @@ mail_config_window_constructed (GObject *object)
        gtk_widget_set_hexpand (widget, TRUE);
        gtk_widget_set_vexpand (widget, TRUE);
        gtk_widget_set_margin_bottom (widget, 17);
+       requisition.height += 17 + 5; /* margin bottom + border width of the grid */
        gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
        gtk_notebook_set_show_border (GTK_NOTEBOOK (widget), FALSE);
        gtk_grid_attach (GTK_GRID (container), widget, 2, 1, 1, 1);
@@ -393,6 +400,15 @@ mail_config_window_constructed (GObject *object)
                window->priv->notebook, "complete",
                widget, "sensitive",
                G_BINDING_SYNC_CREATE);
+
+       npages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->priv->notebook));
+       for (ii = 0; ii < npages; ii++) {
+               children = g_slist_prepend (children, gtk_notebook_get_nth_page (GTK_NOTEBOOK 
(window->priv->notebook), ii));
+       }
+
+       e_util_resize_window_for_screen (GTK_WINDOW (window), requisition.width, requisition.height, 
children);
+
+       g_slist_free (children);
 }
 
 static void
diff --git a/src/modules/backup-restore/e-mail-config-restore-page.c 
b/src/modules/backup-restore/e-mail-config-restore-page.c
index f0270fd..bfa90a0 100644
--- a/src/modules/backup-restore/e-mail-config-restore-page.c
+++ b/src/modules/backup-restore/e-mail-config-restore-page.c
@@ -54,7 +54,7 @@ static void   e_mail_config_restore_page_interface_init
 G_DEFINE_DYNAMIC_TYPE_EXTENDED (
        EMailConfigRestorePage,
        e_mail_config_restore_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        0,
        G_IMPLEMENT_INTERFACE_DYNAMIC (
                E_TYPE_ALERT_SINK,
@@ -149,6 +149,7 @@ mail_config_restore_page_constructed (GObject *object)
        EMailConfigRestorePage *page;
        GtkWidget *widget;
        GtkWidget *container;
+       GtkWidget *main_box;
        const gchar *text;
 
        page = E_MAIL_CONFIG_RESTORE_PAGE (object);
@@ -156,10 +157,7 @@ mail_config_restore_page_constructed (GObject *object)
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_restore_page_parent_class)->constructed (object);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
-
-       gtk_box_set_spacing (GTK_BOX (page), 24);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
 
        text = _("You can restore Evolution from a backup file.\n\n"
                 "This will restore all your personal data, settings "
@@ -167,11 +165,11 @@ mail_config_restore_page_constructed (GObject *object)
        widget = gtk_label_new (text);
        gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -200,7 +198,7 @@ mail_config_restore_page_constructed (GObject *object)
 
        widget = gtk_frame_new (NULL);
        gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        /* Visibility is bound to the EActivityBar. */
 
        container = widget;
@@ -219,6 +217,8 @@ mail_config_restore_page_constructed (GObject *object)
                page->priv->toggle_button, "active",
                page->priv->file_chooser, "sensitive",
                G_BINDING_SYNC_CREATE);
+
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
 }
 
 static void
diff --git a/src/modules/backup-restore/e-mail-config-restore-page.h 
b/src/modules/backup-restore/e-mail-config-restore-page.h
index bf8ce64..575c2f1 100644
--- a/src/modules/backup-restore/e-mail-config-restore-page.h
+++ b/src/modules/backup-restore/e-mail-config-restore-page.h
@@ -52,12 +52,12 @@ typedef struct _EMailConfigRestorePageClass EMailConfigRestorePageClass;
 typedef struct _EMailConfigRestorePagePrivate EMailConfigRestorePagePrivate;
 
 struct _EMailConfigRestorePage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigRestorePagePrivate *priv;
 };
 
 struct _EMailConfigRestorePageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_restore_page_get_type
diff --git a/src/modules/backup-restore/e-mail-config-restore-ready-page.c 
b/src/modules/backup-restore/e-mail-config-restore-ready-page.c
index 20a9176..4eaff15 100644
--- a/src/modules/backup-restore/e-mail-config-restore-ready-page.c
+++ b/src/modules/backup-restore/e-mail-config-restore-ready-page.c
@@ -33,7 +33,7 @@ static void   e_mail_config_restore_ready_page_interface_init
 G_DEFINE_DYNAMIC_TYPE_EXTENDED (
        EMailConfigRestoreReadyPage,
        e_mail_config_restore_ready_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        0,
        G_IMPLEMENT_INTERFACE_DYNAMIC (
                E_TYPE_MAIL_CONFIG_PAGE,
diff --git a/src/modules/backup-restore/e-mail-config-restore-ready-page.h 
b/src/modules/backup-restore/e-mail-config-restore-ready-page.h
index 9a52f32..e714956 100644
--- a/src/modules/backup-restore/e-mail-config-restore-ready-page.h
+++ b/src/modules/backup-restore/e-mail-config-restore-ready-page.h
@@ -53,12 +53,12 @@ typedef struct _EMailConfigRestoreReadyPageClass EMailConfigRestoreReadyPageClas
 typedef struct _EMailConfigRestoreReadyPagePrivate EMailConfigRestoreReadyPagePrivate;
 
 struct _EMailConfigRestoreReadyPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigRestoreReadyPagePrivate *priv;
 };
 
 struct _EMailConfigRestoreReadyPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_restore_ready_page_get_type
diff --git a/src/modules/mail-config/e-mail-config-google-summary.c 
b/src/modules/mail-config/e-mail-config-google-summary.c
index 52db263..e7a0dfd 100644
--- a/src/modules/mail-config/e-mail-config-google-summary.c
+++ b/src/modules/mail-config/e-mail-config-google-summary.c
@@ -241,6 +241,7 @@ mail_config_google_summary_constructed (GObject *object)
        ESource *source;
        GtkWidget *container;
        GtkWidget *widget;
+       GtkBox *main_box;
        const gchar *extension_name;
        const gchar *text;
        gchar *markup, *imap_url, *cal_url;
@@ -251,6 +252,7 @@ mail_config_google_summary_constructed (GObject *object)
        G_OBJECT_CLASS (e_mail_config_google_summary_parent_class)->constructed (object);
 
        page = mail_config_google_summary_get_summary_page (extension);
+       main_box = e_mail_config_summary_page_get_internal_box (page);
 
        /* Use g_signal_connect_after() so the EMailConfigSummaryPage
         * class methods run first.  They make changes to the sources
@@ -266,12 +268,10 @@ mail_config_google_summary_constructed (GObject *object)
                G_CALLBACK (mail_config_google_summary_commit_changes_cb),
                extension);
 
-       container = GTK_WIDGET (page);
-
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, widget, FALSE, FALSE, 0);
 
        e_binding_bind_property (
                extension, "applicable",
diff --git a/src/modules/mail-config/e-mail-config-yahoo-summary.c 
b/src/modules/mail-config/e-mail-config-yahoo-summary.c
index 39dbd89..8a9e6a0 100644
--- a/src/modules/mail-config/e-mail-config-yahoo-summary.c
+++ b/src/modules/mail-config/e-mail-config-yahoo-summary.c
@@ -210,6 +210,7 @@ mail_config_yahoo_summary_constructed (GObject *object)
        ESource *source;
        GtkWidget *container;
        GtkWidget *widget;
+       GtkBox *main_box;
        const gchar *extension_name;
        const gchar *text;
        gchar *markup;
@@ -220,6 +221,7 @@ mail_config_yahoo_summary_constructed (GObject *object)
        G_OBJECT_CLASS (e_mail_config_yahoo_summary_parent_class)->constructed (object);
 
        page = mail_config_yahoo_summary_get_summary_page (extension);
+       main_box = e_mail_config_summary_page_get_internal_box (page);
 
        /* Use g_signal_connect_after() so the EMailConfigSummaryPage
         * class methods run first.  They make changes to the sources
@@ -235,12 +237,10 @@ mail_config_yahoo_summary_constructed (GObject *object)
                G_CALLBACK (mail_config_yahoo_summary_commit_changes_cb),
                extension);
 
-       container = GTK_WIDGET (page);
-
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
-       gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (main_box, widget, FALSE, FALSE, 0);
 
        e_binding_bind_property (
                extension, "applicable",
diff --git a/src/modules/startup-wizard/e-mail-config-import-page.c 
b/src/modules/startup-wizard/e-mail-config-import-page.c
index c81d425..ef5a5e1 100644
--- a/src/modules/startup-wizard/e-mail-config-import-page.c
+++ b/src/modules/startup-wizard/e-mail-config-import-page.c
@@ -49,7 +49,7 @@ static gboolean       mail_config_import_page_next    (gpointer user_data);
 G_DEFINE_DYNAMIC_TYPE_EXTENDED (
        EMailConfigImportPage,
        e_mail_config_import_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        0,
        G_IMPLEMENT_INTERFACE_DYNAMIC (
                E_TYPE_MAIL_CONFIG_PAGE,
@@ -194,6 +194,7 @@ mail_config_import_page_constructed (GObject *object)
        EMailConfigImportPage *page;
        GtkWidget *widget;
        GtkWidget *container;
+       GtkWidget *main_box;
        GSList *list, *link;
        const gchar *text;
        gint row = 0;
@@ -203,22 +204,19 @@ mail_config_import_page_constructed (GObject *object)
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_import_page_parent_class)->constructed (object);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
-
-       gtk_box_set_spacing (GTK_BOX (page), 24);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
 
        text = _("Please select the information "
                 "that you would like to import:");
        widget = gtk_label_new (text);
        gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        widget = gtk_grid_new ();
        gtk_grid_set_row_spacing (GTK_GRID (widget), 12);
        gtk_grid_set_column_spacing (GTK_GRID (widget), 12);
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -245,6 +243,8 @@ mail_config_import_page_constructed (GObject *object)
 
                row++;
        }
+
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
 }
 
 static void
diff --git a/src/modules/startup-wizard/e-mail-config-import-page.h 
b/src/modules/startup-wizard/e-mail-config-import-page.h
index dd02291..97556ac 100644
--- a/src/modules/startup-wizard/e-mail-config-import-page.h
+++ b/src/modules/startup-wizard/e-mail-config-import-page.h
@@ -55,12 +55,12 @@ typedef struct _EMailConfigImportPageClass EMailConfigImportPageClass;
 typedef struct _EMailConfigImportPagePrivate EMailConfigImportPagePrivate;
 
 struct _EMailConfigImportPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigImportPagePrivate *priv;
 };
 
 struct _EMailConfigImportPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_import_page_get_type
diff --git a/src/modules/startup-wizard/e-mail-config-import-progress-page.c 
b/src/modules/startup-wizard/e-mail-config-import-progress-page.c
index 5d19c82..f241c4e 100644
--- a/src/modules/startup-wizard/e-mail-config-import-progress-page.c
+++ b/src/modules/startup-wizard/e-mail-config-import-progress-page.c
@@ -44,7 +44,7 @@ static void   e_mail_config_import_progress_page_interface_init
 G_DEFINE_DYNAMIC_TYPE_EXTENDED (
        EMailConfigImportProgressPage,
        e_mail_config_import_progress_page,
-       GTK_TYPE_BOX,
+       GTK_TYPE_SCROLLED_WINDOW,
        0,
        G_IMPLEMENT_INTERFACE_DYNAMIC (
                E_TYPE_MAIL_CONFIG_PAGE,
@@ -165,6 +165,7 @@ mail_config_import_progress_page_constructed (GObject *object)
        GtkSizeGroup *size_group;
        GtkWidget *container;
        GtkWidget *widget;
+       GtkWidget *main_box;
        EActivity *activity;
 
        page = E_MAIL_CONFIG_IMPORT_PROGRESS_PAGE (object);
@@ -172,12 +173,9 @@ mail_config_import_progress_page_constructed (GObject *object)
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_mail_config_import_progress_page_parent_class)->constructed (object);
 
-       gtk_orientable_set_orientation (
-               GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
+       main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
 
-       gtk_box_set_spacing (GTK_BOX (page), 12);
-
-       gtk_widget_set_valign (GTK_WIDGET (page), GTK_ALIGN_CENTER);
+       gtk_widget_set_valign (GTK_WIDGET (main_box), GTK_ALIGN_CENTER);
 
        activity = e_mail_config_import_progress_page_get_activity (page);
 
@@ -191,11 +189,11 @@ mail_config_import_progress_page_constructed (GObject *object)
        /* Just a spacer. */
        widget = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
        gtk_size_group_add_widget (size_group, widget);
-       gtk_box_pack_start (GTK_BOX (page), widget, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, TRUE, TRUE, 0);
        gtk_widget_show (widget);
 
        widget = gtk_progress_bar_new ();
-       gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, FALSE, FALSE, 0);
        page->priv->progress_bar = widget;  /* not referenced */
        gtk_widget_show (widget);
 
@@ -214,7 +212,7 @@ mail_config_import_progress_page_constructed (GObject *object)
 
        widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
        gtk_size_group_add_widget (size_group, widget);
-       gtk_box_pack_start (GTK_BOX (page), widget, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (main_box), widget, TRUE, TRUE, 0);
        gtk_widget_show (widget);
 
        container = widget;
@@ -278,6 +276,8 @@ mail_config_import_progress_page_constructed (GObject *object)
        gtk_widget_show (widget);
 
        g_object_unref (size_group);
+
+       e_mail_config_page_set_content (E_MAIL_CONFIG_PAGE (page), main_box);
 }
 
 static gboolean
diff --git a/src/modules/startup-wizard/e-mail-config-import-progress-page.h 
b/src/modules/startup-wizard/e-mail-config-import-progress-page.h
index 4e937fe..e63dbba 100644
--- a/src/modules/startup-wizard/e-mail-config-import-progress-page.h
+++ b/src/modules/startup-wizard/e-mail-config-import-progress-page.h
@@ -54,12 +54,12 @@ typedef struct _EMailConfigImportProgressPageClass EMailConfigImportProgressPage
 typedef struct _EMailConfigImportProgressPagePrivate EMailConfigImportProgressPagePrivate;
 
 struct _EMailConfigImportProgressPage {
-       GtkBox parent;
+       GtkScrolledWindow parent;
        EMailConfigImportProgressPagePrivate *priv;
 };
 
 struct _EMailConfigImportProgressPageClass {
-       GtkBoxClass parent_class;
+       GtkScrolledWindowClass parent_class;
 };
 
 GType          e_mail_config_import_progress_page_get_type


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