New method modest_maemo_utils_create_caption_with_size_type
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 4 Dec 2008 21:19:49 +0000 (21:19 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 4 Dec 2008 21:19:49 +0000 (21:19 +0000)
Refactored to create new method
modest_maemo_utils_create_caption_with_size_type, allowing developer to
set a specific size type. We need this for recipient editors with a free
height.

pmo-drop-split-view-r6650

src/hildon2/modest-maemo-utils.c
src/hildon2/modest-maemo-utils.h

index 0f56b59..2d81c68 100644 (file)
@@ -309,6 +309,34 @@ modest_maemo_utils_create_captioned    (GtkSizeGroup *title_size_group,
                                        const gchar *title,
                                        GtkWidget *control)
 {
+       return modest_maemo_utils_create_captioned_with_size_type (title_size_group,
+                                                                  value_size_group,
+                                                                  title,
+                                                                  control,
+                                                                  HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+}
+
+/**
+ * modest_maemo_utils_create_captioned_with_size_type:
+ * @title_size_group: a #GtkSizeGroup
+ * @value_size_group: a #GtkSizeGroup
+ * @title: a string
+ * @control: a #GtkWidget
+ * @size_type: a #HildonSizeType
+ *
+ * this creates a widget (a #GtkHBox) with a control, and a label
+ * (@string) captioning it. It also uses the proper size groups for title
+ * and control.
+ *
+ * Returns: a widget containing the control and a proper label.
+ */
+GtkWidget *
+modest_maemo_utils_create_captioned_with_size_type    (GtkSizeGroup *title_size_group,
+                                                      GtkSizeGroup *value_size_group,
+                                                      const gchar *title,
+                                                      GtkWidget *control,
+                                                      HildonSizeType size_type)
+{
        GtkWidget *label;
        GtkWidget *box;
   
@@ -323,7 +351,7 @@ modest_maemo_utils_create_captioned    (GtkSizeGroup *title_size_group,
        if (value_size_group)
                gtk_size_group_add_widget (value_size_group, control);
 
-       hildon_gtk_widget_set_theme_size (control, HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+       hildon_gtk_widget_set_theme_size (control, size_type);
 
        return box;
 }
index e3f03c1..3bf1c5b 100644 (file)
@@ -37,6 +37,7 @@
 #include <libosso.h>
 #include "widgets/modest-global-settings-dialog.h"
 #include "widgets/modest-validating-entry.h"
+#include <hildon/hildon-gtk.h>
 
 #define MODEST_MAEMO_UTILS_MYDOCS_FOLDER "MyDocs"
 #define MODEST_MAEMO_UTILS_DEFAULT_IMAGE_FOLDER ".images"
@@ -128,6 +129,12 @@ GtkWidget *modest_maemo_utils_create_captioned    (GtkSizeGroup *title_size_grou
                                                   const gchar *title,
                                                   GtkWidget *control);
 
+GtkWidget *modest_maemo_utils_create_captioned_with_size_type    (GtkSizeGroup *title_size_group,
+                                                                 GtkSizeGroup *value_size_group,
+                                                                 const gchar *title,
+                                                                 GtkWidget *control,
+                                                                 HildonSizeType size_type);
+
 void       modest_maemo_utils_set_hbutton_layout (GtkSizeGroup *title_sizegroup, 
                                                  GtkSizeGroup *value_sizegroup,
                                                  const gchar *title,