2007-04-23 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Mon, 23 Apr 2007 13:58:56 +0000 (13:58 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Mon, 23 Apr 2007 13:58:56 +0000 (13:58 +0000)
* src/maemo/Makefile.am:
        * src/maemo/modest-maemo-ui-constants.h: New header with some defines for widget spacing,
        based on maemo-develoers email from Dirk.

        * src/maemo/easysetup/modest-easysetup-wizard.c:
        (create_page_welcome), (create_page_account_details),
        (create_page_user_details), (create_page_complete_easysetup),
        (create_page_custom_incoming), (create_page_custom_outgoing),
        (create_page_complete_custom),
        (modest_easysetup_wizard_dialog_init):
        * src/maemo/modest-account-settings-dialog.c:
        (create_page_account_details), (create_page_user_details),
        (create_page_incoming), (create_page_outgoing),
        (modest_account_settings_dialog_init):
        * src/maemo/modest-connection-specific-smtp-window.c:
        (modest_connection_specific_smtp_window_init): Used the smallest of the spacing constants.

pmo-trunk-r1637

ChangeLog2
src/maemo/Makefile.am
src/maemo/easysetup/modest-easysetup-wizard.c
src/maemo/modest-account-settings-dialog.c
src/maemo/modest-connection-specific-smtp-window.c
src/maemo/modest-maemo-ui-constants.h [new file with mode: 0644]

index 67452a6..fd25cb8 100644 (file)
@@ -1,5 +1,24 @@
 2007-04-23  Murray Cumming  <murrayc@murrayc.com>
 
+       * src/maemo/Makefile.am:
+       * src/maemo/modest-maemo-ui-constants.h: New header with some defines for widget spacing, 
+       based on maemo-develoers email from Dirk.
+       
+       * src/maemo/easysetup/modest-easysetup-wizard.c:
+       (create_page_welcome), (create_page_account_details),
+       (create_page_user_details), (create_page_complete_easysetup),
+       (create_page_custom_incoming), (create_page_custom_outgoing),
+       (create_page_complete_custom),
+       (modest_easysetup_wizard_dialog_init):
+       * src/maemo/modest-account-settings-dialog.c:
+       (create_page_account_details), (create_page_user_details),
+       (create_page_incoming), (create_page_outgoing),
+       (modest_account_settings_dialog_init):
+       * src/maemo/modest-connection-specific-smtp-window.c:
+       (modest_connection_specific_smtp_window_init): Used the smallest of the spacing constants.
+
+2007-04-23  Murray Cumming  <murrayc@murrayc.com>
+
        * src/maemo/easysetup/modest-easysetup-wizard.c:
        (create_page_account_details), (create_page_custom_outgoing),
        (create_page_complete_custom):
index 5da79f6..e4f8c5b 100644 (file)
@@ -47,6 +47,7 @@ libmodest_ui_la_SOURCES=              \
        modest-account-view-window.c  \
        modest-address-book.c         \
        modest-icon-names.h           \
+       modest-maemo-ui-constants.h \
        modest-main-window.c          \
        modest-main-window-ui.h       \
        modest-platform.c             \
index 5919ee3..5039947 100644 (file)
@@ -27,6 +27,7 @@
 #include "modest-account-mgr-helpers.h"
 #include "modest-runtime.h" /* For modest_runtime_get_account_mgr(). */
 #include "maemo/modest-connection-specific-smtp-window.h"
+#include "maemo/modest-maemo-ui-constants.h"
 #include <gconf/gconf-client.h>
 #include <string.h> /* For strlen(). */
 
@@ -189,7 +190,7 @@ static GtkWidget* create_caption_new_with_asterix(ModestEasysetupWizardDialog *s
 static GtkWidget*
 create_page_welcome (ModestEasysetupWizardDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        GtkWidget *label = gtk_label_new(_("mcen_ia_emailsetup_intro"));
        gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
        gtk_widget_show (label);
@@ -241,9 +242,9 @@ on_combo_account_serviceprovider (GtkComboBox *widget, gpointer user_data)
 static GtkWidget*
 create_page_account_details (ModestEasysetupWizardDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        GtkWidget *label = gtk_label_new(_("mcen_ia_accountdetails"));
-       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (label);
        
        /* Create a size group to be used by all captions.
@@ -256,7 +257,7 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
        GtkWidget *caption = create_caption_new_with_asterix (self, sizegroup, _("mcen_fi_country"), 
                self->combo_account_country, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_account_country);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* connect to country combo's changed signal, so we can fill the provider combo: */
@@ -264,7 +265,7 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
             G_CALLBACK (on_combo_account_country), self);
             
        GtkWidget *separator = gtk_hseparator_new ();
-       gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (separator);
             
        /* The service provider widgets: */     
@@ -273,7 +274,7 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
        caption = create_caption_new_with_asterix (self, sizegroup, _("mcen_fi_serviceprovider"), 
                self->combo_account_serviceprovider, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_account_serviceprovider);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* connect to providers combo's changed signal, so we can fill the email address: */
@@ -336,7 +337,7 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
        caption = create_caption_new_with_asterix (self, sizegroup, _("mcen_fi_account_title"), 
                self->entry_account_title, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->entry_account_title);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Prevent the use of some characters in the account title, 
@@ -369,7 +370,7 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
 static GtkWidget*
 create_page_user_details (ModestEasysetupWizardDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
@@ -384,7 +385,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
        GtkWidget *caption = create_caption_new_with_asterix (self, sizegroup, 
                _("mcen_li_emailsetup_name"), self->entry_user_name, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_user_name);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Prevent the use of some characters in the name, 
@@ -401,7 +402,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
        caption = create_caption_new_with_asterix (self, sizegroup, _("mail_fi_username"), 
                self->entry_user_username, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->entry_user_username);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Prevent the use of some characters in the username, 
@@ -420,7 +421,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
        caption = create_caption_new_with_asterix (self, sizegroup, 
                _("mail_fi_password"), self->entry_user_password, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_user_password);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* The email address widgets: */        
@@ -429,7 +430,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
                _("mcen_li_emailsetup_email_address"), self->entry_user_email, NULL, HILDON_CAPTION_MANDATORY);
        gtk_entry_set_text (GTK_ENTRY (self->entry_user_email), EXAMPLE_EMAIL_ADDRESS); /* Default text. */
        gtk_widget_show (self->entry_user_email);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Set max length as in the UI spec:
@@ -444,7 +445,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
 
 static GtkWidget* create_page_complete_easysetup (ModestEasysetupWizardDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        GtkWidget *label = gtk_label_new(_("mcen_ia_emailsetup_setup_complete"));
        gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
        gtk_widget_show (label);
@@ -496,7 +497,7 @@ static void on_combo_servertype_changed(GtkComboBox *combobox, gpointer user_dat
            
 static GtkWidget* create_page_custom_incoming (ModestEasysetupWizardDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
@@ -511,7 +512,7 @@ static GtkWidget* create_page_custom_incoming (ModestEasysetupWizardDialog *self
        GtkWidget *caption = create_caption_new_with_asterix (self, sizegroup, 
                _("mcen_li_emailsetup_type"), self->combo_incoming_servertype, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->combo_incoming_servertype);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        if(!self->entry_incomingserver)
@@ -528,7 +529,7 @@ static GtkWidget* create_page_custom_incoming (ModestEasysetupWizardDialog *self
                "Incoming Server", self->entry_incomingserver, NULL, HILDON_CAPTION_MANDATORY);
        update_incoming_server_title (self);
        gtk_widget_show (self->entry_incomingserver);
-       gtk_box_pack_start (GTK_BOX (box), self->caption_incoming, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->caption_incoming, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->caption_incoming);
        
        /* Change the caption title when the servertype changes, 
@@ -545,13 +546,13 @@ static GtkWidget* create_page_custom_incoming (ModestEasysetupWizardDialog *self
        caption = hildon_caption_new (sizegroup, _("mcen_li_emailsetup_secure_connection"), 
                self->combo_incoming_security, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_incoming_security);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        if(!self->checkbox_incoming_auth)
                self->checkbox_incoming_auth = 
                        gtk_check_button_new_with_label (_("mcen_li_emailsetup_secure_authentication"));
-       gtk_box_pack_start (GTK_BOX (box), self->checkbox_incoming_auth, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->checkbox_incoming_auth, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->checkbox_incoming_auth);
        
        gtk_widget_show (GTK_WIDGET (box));
@@ -601,7 +602,7 @@ on_button_outgoing_smtp_servers (GtkButton *button, gpointer user_data)
 
 static GtkWidget* create_page_custom_outgoing (ModestEasysetupWizardDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
@@ -614,7 +615,7 @@ static GtkWidget* create_page_custom_outgoing (ModestEasysetupWizardDialog *self
        GtkWidget *caption = create_caption_new_with_asterix (self, sizegroup, 
                _("mcen_li_emailsetup_smtp"), self->entry_outgoingserver, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_outgoingserver);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        set_default_custom_servernames (self);
        
@@ -628,7 +629,7 @@ static GtkWidget* create_page_custom_outgoing (ModestEasysetupWizardDialog *self
        caption = hildon_caption_new (sizegroup, _("mcen_li_emailsetup_secure_connection"), 
                self->combo_outgoing_security, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_outgoing_security);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* The secure authentication widgets: */
@@ -637,7 +638,7 @@ static GtkWidget* create_page_custom_outgoing (ModestEasysetupWizardDialog *self
        caption = hildon_caption_new (sizegroup, _("mcen_li_emailsetup_secure_authentication"), 
                self->combo_outgoing_auth, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_outgoing_auth);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* connection-specific checkbox: */
@@ -646,11 +647,11 @@ static GtkWidget* create_page_custom_outgoing (ModestEasysetupWizardDialog *self
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->checkbox_outgoing_smtp_specific), 
                        FALSE);
        }
-       gtk_box_pack_start (GTK_BOX (box), self->checkbox_outgoing_smtp_specific, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->checkbox_outgoing_smtp_specific, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->checkbox_outgoing_smtp_specific);
        
        GtkWidget *separator = gtk_hseparator_new ();
-       gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (separator);
        
        /* Connection-specific SMTP-Severs Edit button: */
@@ -660,7 +661,7 @@ static GtkWidget* create_page_custom_outgoing (ModestEasysetupWizardDialog *self
                self->button_outgoing_smtp_servers, NULL, HILDON_CAPTION_OPTIONAL);
        hildon_caption_set_child_expand (HILDON_CAPTION (caption), FALSE);
        gtk_widget_show (self->button_outgoing_smtp_servers);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Only enable the button when the checkbox is checked: */
@@ -678,7 +679,7 @@ static GtkWidget* create_page_custom_outgoing (ModestEasysetupWizardDialog *self
 
 static GtkWidget* create_page_complete_custom (ModestEasysetupWizardDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        GtkWidget *label = gtk_label_new(_("mcen_ia_emailsetup_setup_complete"));
        gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
        gtk_widget_show (label);
@@ -689,7 +690,7 @@ static GtkWidget* create_page_complete_custom (ModestEasysetupWizardDialog *self
                self->button_edit, NULL, HILDON_CAPTION_OPTIONAL);
        hildon_caption_set_child_expand (HILDON_CAPTION (caption), FALSE);
        gtk_widget_show (self->button_edit);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        gtk_widget_show (GTK_WIDGET (box));
@@ -711,6 +712,8 @@ on_response (ModestWizardDialog *wizard_dialog,
 static void
 modest_easysetup_wizard_dialog_init (ModestEasysetupWizardDialog *self)
 {
+       gtk_container_set_border_width (GTK_CONTAINER (self), MODEST_MARGIN_HALF);
+       
        /* Create the notebook to be used by the ModestWizardDialog base class:
         * Each page of the notebook will be a page of the wizard: */
        GtkNotebook *notebook = GTK_NOTEBOOK (gtk_notebook_new());
index 5370b84..505e91f 100644 (file)
@@ -27,6 +27,7 @@
 #include "modest-account-mgr-helpers.h" /* For modest_account_mgr_get_account_data(). */
 #include "modest-runtime.h" /* For modest_runtime_get_account_mgr(). */
 #include "maemo/modest-connection-specific-smtp-window.h"
+#include <maemo/modest-maemo-ui-constants.h>
 #include <gconf/gconf-client.h>
 #include <string.h> /* For strlen(). */
 
@@ -214,9 +215,9 @@ static GtkWidget* create_caption_new_with_asterix(ModestAccountSettingsDialog *s
 static GtkWidget*
 create_page_account_details (ModestAccountSettingsDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        GtkWidget *label = gtk_label_new(_("mcen_ia_accountdetails"));
-       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (label);
        
        /* Create a size group to be used by all captions.
@@ -230,7 +231,7 @@ create_page_account_details (ModestAccountSettingsDialog *self)
                self->entry_account_title, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->entry_account_title);
        connect_for_modified (self, self->entry_account_title);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Prevent the use of some characters in the account title, 
@@ -261,7 +262,7 @@ create_page_account_details (ModestAccountSettingsDialog *self)
                self->combo_retrieve, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->combo_retrieve);
        connect_for_modified (self, self->combo_retrieve);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* The limit-retrieve combobox: */
@@ -270,14 +271,14 @@ create_page_account_details (ModestAccountSettingsDialog *self)
                self->combo_limit_retrieve, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->combo_limit_retrieve);
        connect_for_modified (self, self->combo_limit_retrieve);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
 
        /* The leave-messages widgets: */
        if(!self->checkbox_leave_messages)
                self->checkbox_leave_messages = 
                        gtk_check_button_new_with_label (_("mcen_fi_advsetup_leave_on_server"));
-       gtk_box_pack_start (GTK_BOX (box), self->checkbox_leave_messages, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->checkbox_leave_messages, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->checkbox_leave_messages);
        connect_for_modified (self, self->checkbox_leave_messages);
        
@@ -295,7 +296,7 @@ on_button_signature (GtkButton *button, gpointer user_data)
 static GtkWidget*
 create_page_user_details (ModestAccountSettingsDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
@@ -311,7 +312,7 @@ create_page_user_details (ModestAccountSettingsDialog *self)
                _("mcen_li_emailsetup_name"), self->entry_user_name, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_user_name);
        connect_for_modified (self, self->entry_user_name);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Prevent the use of some characters in the name, 
@@ -329,7 +330,7 @@ create_page_user_details (ModestAccountSettingsDialog *self)
                self->entry_user_username, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->entry_user_username);
        connect_for_modified (self, self->entry_user_username);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Prevent the use of some characters in the username, 
@@ -349,7 +350,7 @@ create_page_user_details (ModestAccountSettingsDialog *self)
                _("mail_fi_password"), self->entry_user_password, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_user_password);
        connect_for_modified (self, self->entry_user_password);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* The email address widgets: */        
@@ -359,7 +360,7 @@ create_page_user_details (ModestAccountSettingsDialog *self)
        gtk_entry_set_text (GTK_ENTRY (self->entry_user_email), EXAMPLE_EMAIL_ADDRESS); /* Default text. */
        gtk_widget_show (self->entry_user_email);
        connect_for_modified (self, self->entry_user_email);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Set max length as in the UI spec:
@@ -374,7 +375,7 @@ create_page_user_details (ModestAccountSettingsDialog *self)
                self->button_signature, NULL, HILDON_CAPTION_OPTIONAL);
        hildon_caption_set_child_expand (HILDON_CAPTION (caption), FALSE);
        gtk_widget_show (self->button_signature);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
                
        g_signal_connect (G_OBJECT (self->button_signature), "clicked",
@@ -417,7 +418,7 @@ static void update_incoming_server_security_choices (ModestAccountSettingsDialog
            
 static GtkWidget* create_page_incoming (ModestAccountSettingsDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
@@ -438,7 +439,7 @@ static GtkWidget* create_page_incoming (ModestAccountSettingsDialog *self)
                "Incoming Server", self->entry_incomingserver, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->entry_incomingserver);
        connect_for_modified (self, self->entry_incomingserver);
-       gtk_box_pack_start (GTK_BOX (box), self->caption_incoming, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->caption_incoming, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->caption_incoming);
        
        /* The secure connection widgets: */
@@ -449,7 +450,7 @@ static GtkWidget* create_page_incoming (ModestAccountSettingsDialog *self)
                self->combo_incoming_security, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_incoming_security);
        connect_for_modified (self, self->combo_incoming_security);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Show a default port number when the security method changes, as per the UI spec: */
@@ -464,14 +465,14 @@ static GtkWidget* create_page_incoming (ModestAccountSettingsDialog *self)
                self->entry_incoming_port, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_incoming_port);
        connect_for_modified (self, self->entry_incoming_port);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* The secure authentication widgets: */
        if(!self->checkbox_incoming_auth)
                self->checkbox_incoming_auth = 
                        gtk_check_button_new_with_label (_("mcen_li_emailsetup_secure_authentication"));
-       gtk_box_pack_start (GTK_BOX (box), self->checkbox_incoming_auth, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->checkbox_incoming_auth, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->checkbox_incoming_auth);
        connect_for_modified (self, self->checkbox_incoming_auth);
        
@@ -568,7 +569,7 @@ on_combo_incoming_security_changed (GtkComboBox *widget, gpointer user_data)
 
 static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
 {
-       GtkWidget *box = gtk_vbox_new (FALSE, 2);
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
@@ -582,7 +583,7 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
                _("mcen_li_emailsetup_smtp"), self->entry_outgoingserver, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_outgoingserver);
        connect_for_modified (self, self->entry_outgoingserver);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* The secure authentication widgets: */
@@ -592,7 +593,7 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
                self->combo_outgoing_auth, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_outgoing_auth);
        connect_for_modified (self, self->combo_outgoing_auth);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Dim the outgoing username and password when no secure authentication is used, as per the UI spec: */
@@ -604,7 +605,7 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
                self->entry_outgoing_username, NULL, HILDON_CAPTION_MANDATORY);
        gtk_widget_show (self->entry_outgoing_username);
        connect_for_modified (self, self->entry_outgoing_username);
-       gtk_box_pack_start (GTK_BOX (box), self->caption_outgoing_username, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->caption_outgoing_username, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->caption_outgoing_username);
        
        /* Prevent the use of some characters in the username, 
@@ -624,7 +625,7 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
                _("mail_fi_password"), self->entry_outgoing_password, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_outgoing_password);
        connect_for_modified (self, self->entry_outgoing_password);
-       gtk_box_pack_start (GTK_BOX (box), self->caption_outgoing_password, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->caption_outgoing_password, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->caption_outgoing_password);
        
        /* The secure connection widgets: */
@@ -637,7 +638,7 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
                self->combo_outgoing_security, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->combo_outgoing_security);
        connect_for_modified (self, self->combo_outgoing_security);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Show a default port number when the security method changes, as per the UI spec: */
@@ -650,11 +651,11 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
                self->entry_outgoing_port, NULL, HILDON_CAPTION_OPTIONAL);
        gtk_widget_show (self->entry_outgoing_port);
        connect_for_modified (self, self->entry_outgoing_port);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        GtkWidget *separator = gtk_hseparator_new ();
-       gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (separator);
        
        /* connection-specific checkbox: */
@@ -663,7 +664,7 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->checkbox_outgoing_smtp_specific), 
                        FALSE);
        }
-       gtk_box_pack_start (GTK_BOX (box), self->checkbox_outgoing_smtp_specific, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), self->checkbox_outgoing_smtp_specific, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (self->checkbox_outgoing_smtp_specific);
        connect_for_modified (self, self->checkbox_outgoing_smtp_specific);
        
@@ -674,7 +675,7 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self)
                self->button_outgoing_smtp_servers, NULL, HILDON_CAPTION_OPTIONAL);
        hildon_caption_set_child_expand (HILDON_CAPTION (caption), FALSE);
        gtk_widget_show (self->button_outgoing_smtp_servers);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
        
        /* Only enable the button when the checkbox is checked: */
@@ -817,6 +818,7 @@ modest_account_settings_dialog_init (ModestAccountSettingsDialog *self)
                
        GtkDialog *dialog = GTK_DIALOG (self);
        gtk_container_add (GTK_CONTAINER (dialog->vbox), GTK_WIDGET (notebook));
+       gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), MODEST_MARGIN_HALF);
        gtk_widget_show (GTK_WIDGET (notebook));
         
     /* Add the buttons: */
index 3e018fe..5a58945 100644 (file)
@@ -3,6 +3,7 @@
 #include "modest-connection-specific-smtp-window.h"
 #include "modest-connection-specific-smtp-edit-window.h"
 #include <modest-account-mgr-helpers.h>
+#include <maemo/modest-maemo-ui-constants.h>
 
 #include <modest-runtime.h>
 #include <tny-maemo-conic-device.h>
@@ -304,28 +305,28 @@ modest_connection_specific_smtp_window_init (ModestConnectionSpecificSmtpWindow
        
        /* The application must call modest_connection_specific_smtp_window_fill_with_connections(). */
        
-       GtkWidget *vbox = gtk_vbox_new (FALSE, 2);
+       GtkWidget *vbox = gtk_vbox_new (FALSE, MODEST_MARGIN_HALF);
        
        /* Put the treeview in a scrolled window and add it to the box: */
        GtkWidget *scrolled_window = gtk_scrolled_window_new (NULL, NULL);
        gtk_widget_show (scrolled_window);
        gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (priv->treeview));
-       gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (scrolled_window), TRUE, TRUE, 2);
+       gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (scrolled_window), TRUE, TRUE, MODEST_MARGIN_HALF);
        gtk_widget_show (GTK_WIDGET (priv->treeview));
        
        /* Add the buttons: */
-       GtkWidget *hbox = gtk_hbox_new (FALSE, 2);
-       gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2);
+       GtkWidget *hbox = gtk_hbox_new (FALSE, MODEST_MARGIN_HALF);
+       gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (hbox);
        
        priv->button_edit = gtk_button_new_from_stock (GTK_STOCK_EDIT);
-       gtk_box_pack_start (GTK_BOX (hbox), priv->button_edit, TRUE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (hbox), priv->button_edit, TRUE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (priv->button_edit);
        g_signal_connect (G_OBJECT (priv->button_edit), "clicked",
                G_CALLBACK (on_button_edit), self);
        
        GtkWidget *button_cancel = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-       gtk_box_pack_start (GTK_BOX (hbox), button_cancel, TRUE, FALSE, 2);
+       gtk_box_pack_start (GTK_BOX (hbox), button_cancel, TRUE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (button_cancel);
        g_signal_connect (G_OBJECT (button_cancel), "clicked",
                G_CALLBACK (on_button_cancel), self);
diff --git a/src/maemo/modest-maemo-ui-constants.h b/src/maemo/modest-maemo-ui-constants.h
new file mode 100644 (file)
index 0000000..f1a609f
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright (c) 2007, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef __MODEST_MAEMO_UI_CONSTANTS_H__
+#define __MODEST_MAEMO_UI_CONSTANTS_H__
+
+/* These are based on an email on the maemo-developers mailing list from Dirk-Jan Binnema, 
+ * title "RE: Standard widget spacing and padding?":
+ */
+#define MODEST_MARGIN_DEFAULT 6
+#define MODEST_MARGIN_DOUBLE 12
+#define MODEST_MARGIN_TRIPLE 18
+#define MODEST_MARGIN_HALF 3
+
+#endif /*__MODEST_MAEMO_UI_CONSTANTS_H__*/