Use scrollable in some still not migrated places
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 29 Oct 2009 18:48:01 +0000 (19:48 +0100)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 29 Oct 2009 18:48:01 +0000 (19:48 +0100)
src/hildon2/modest-hildon-includes.h
src/hildon2/modest-hildon2-details-dialog.c
src/hildon2/modest-hildon2-global-settings-dialog.c
src/hildon2/modest-maemo-utils.c
src/hildon2/modest-maemo-utils.h
src/modest-ui-actions.c
src/widgets/modest-gtkhtml-mime-part-view.c

index 81e9406..051fbbf 100644 (file)
@@ -75,7 +75,6 @@
 #include <hildon/hildon-entry.h>
 #include <hildon/hildon-picker-button.h>
 #include <hildon/hildon-check-button.h>
-#include <hildon/hildon-pannable-area.h>
 #include <hildon/hildon-stackable-window.h>
 #include <hildon/hildon-text-view.h>
 
index 2bc983a..ab7c36b 100644 (file)
@@ -43,8 +43,9 @@
 #include <modest-tny-account.h>
 #include <modest-text-utils.h>
 #include "modest-hildon2-details-dialog.h"
-#include <hildon/hildon-pannable-area.h>
+#include <modest-scrollable.h>
 #include <modest-ui-constants.h>
+#include <modest-runtime.h>
 
 static void modest_hildon2_details_dialog_create_container_default (ModestDetailsDialog *self);
 
@@ -131,7 +132,7 @@ static void
 modest_hildon2_details_dialog_create_container_default (ModestDetailsDialog *self)
 {
        ModestHildon2DetailsDialogPrivate *priv;
-       GtkWidget *pannable;
+       GtkWidget *scrollable;
        GtkWidget *align;
 
        priv = MODEST_HILDON2_DETAILS_DIALOG_GET_PRIVATE (self);
@@ -145,11 +146,11 @@ modest_hildon2_details_dialog_create_container_default (ModestDetailsDialog *sel
        align = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
        gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, MODEST_MARGIN_DOUBLE, MODEST_MARGIN_DEFAULT);
 
-       pannable = g_object_new (HILDON_TYPE_PANNABLE_AREA, "initial-hint", TRUE, NULL);
+       scrollable = modest_toolkit_factory_create_scrollable (modest_runtime_get_toolkit_factory ());
        gtk_container_add (GTK_CONTAINER (align), priv->props_table);
-       hildon_pannable_area_add_with_viewport (HILDON_PANNABLE_AREA (pannable), 
-                                               GTK_WIDGET (align));
-       gtk_container_add (GTK_CONTAINER (GTK_DIALOG (self)->vbox), pannable);
+       modest_scrollable_add_with_viewport (MODEST_SCROLLABLE (scrollable), 
+                                            GTK_WIDGET (align));
+       gtk_container_add (GTK_CONTAINER (GTK_DIALOG (self)->vbox), scrollable);
 
        gtk_dialog_set_has_separator (GTK_DIALOG (self), FALSE);
 }
index ac94324..54062fd 100644 (file)
@@ -32,6 +32,7 @@
 #endif /*HAVE_CONFIG_H*/
 
 #include <modest-hildon-includes.h>
+#include <modest-scrollable.h>
 #include <modest-maemo-utils.h>
 
 #include <glib/gi18n.h>
@@ -44,7 +45,6 @@
 #include "modest-runtime.h"
 #include "widgets/modest-global-settings-dialog-priv.h"
 #include "modest-selector-picker.h"
-#include "hildon/hildon-pannable-area.h"
 #include "modest-hildon2-global-settings-dialog.h"
 #include "widgets/modest-ui-constants.h"
 #include "modest-text-utils.h"
@@ -196,7 +196,7 @@ create_updating_page (ModestHildon2GlobalSettingsDialog *self)
        GtkSizeGroup *title_size_group;
        GtkSizeGroup *value_size_group;
        ModestGlobalSettingsDialogPrivate *ppriv;
-       GtkWidget *pannable, *separator;
+       GtkWidget *scrollable, *separator;
        ModestHildon2GlobalSettingsDialogPrivate *priv;
 
        priv = MODEST_HILDON2_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self);
@@ -286,16 +286,16 @@ create_updating_page (ModestHildon2GlobalSettingsDialog *self)
                                               ppriv->update_interval);
        gtk_box_pack_start (GTK_BOX (vbox), ppriv->update_interval, FALSE, FALSE, 0);
 
-       pannable = g_object_new (HILDON_TYPE_PANNABLE_AREA, "initial-hint", TRUE, NULL);
+       scrollable = modest_toolkit_factory_create_scrollable (modest_runtime_get_toolkit_factory ());
 
-       hildon_pannable_area_add_with_viewport (HILDON_PANNABLE_AREA (pannable), vbox);
+       modest_scrollable_add_with_viewport (MODEST_SCROLLABLE (scrollable), vbox);
        gtk_widget_show (vbox);
-       gtk_widget_show (pannable);
+       gtk_widget_show (scrollable);
 
        g_object_unref (title_size_group);
        g_object_unref (value_size_group);
 
-       return pannable;
+       return scrollable;
 }
 
 
index dd71fcf..2eec6da 100644 (file)
@@ -588,45 +588,6 @@ modest_maemo_utils_in_usb_mode ()
 }
 #endif
 
-void
-modest_maemo_utils_scroll_pannable (HildonPannableArea *pannable,
-                                   gint horizontal,
-                                   gint vertical)
-{
-       gint h_pos = -1;
-       gint v_pos = -1;
-
-       g_assert (pannable);
-       /* at atleast one of values have to be valid */
-       g_return_if_fail (h_pos == -1 && v_pos == -1);
-
-       if (horizontal != 0) {
-               GtkAdjustment *h_adj;
-
-               h_adj = hildon_pannable_area_get_hadjustment (pannable);
-               g_return_if_fail (h_adj);
-
-               h_pos = h_adj->value + h_adj->step_increment * horizontal;
-               if (horizontal > 0) {
-                       h_pos += h_adj->page_size;
-               }
-       }
-
-       if (vertical != 0) {
-               GtkAdjustment *v_adj;
-
-               v_adj = hildon_pannable_area_get_vadjustment (pannable);
-               g_return_if_fail (v_adj);
-
-               v_pos = v_adj->value + v_adj->step_increment * vertical;
-               if (vertical > 0) {
-                       v_pos += v_adj->page_size;
-               }
-       }
-
-       hildon_pannable_area_scroll_to (pannable, h_pos, v_pos);
-}
-
 #ifdef MODEST_USE_IPHB
 
 typedef struct _ModestHeartbeatSource {
index 71d909b..776ce27 100644 (file)
@@ -38,7 +38,6 @@
 #include "widgets/modest-global-settings-dialog.h"
 #include "widgets/modest-validating-entry.h"
 #include <hildon/hildon-gtk.h>
-#include <hildon/hildon-pannable-area.h>
 
 #define MODEST_MAEMO_UTILS_MYDOCS_ENV "MYDOCSDIR"
 #define MODEST_MAEMO_UTILS_DEFAULT_IMAGE_FOLDER ".images"
@@ -160,21 +159,6 @@ gboolean modest_maemo_utils_in_usb_mode ();
 #endif
 
 /**
- * modest_maemo_utils_scroll_pannable:
- * @pannable: a #HildonPannableArea
- * @horizontal: the amount to scroll in horizontal direction
- * @vertical: the amount to scroll in vertical direction
- *
- * Performs some scrolling over a pannable area. The amount of
- * scrolling is expressed in step_increments of the pannable area
- * GtkAdjustments
- **/
-void
-modest_maemo_utils_scroll_pannable(HildonPannableArea *pannable,
-                                  gint horizontal,
-                                  gint vertical);
-
-/**
  * modest_heartbeat_add:
  * @function: function to call
  * @userdata: data to pass to @function.
index 22b9011..a39b1b3 100644 (file)
@@ -52,7 +52,6 @@
 #include <tny-camel-pop-folder.h>
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <modest-accounts-window.h>
-#include <hildon/hildon-pannable-area.h>
 #include <hildon/hildon-gtk.h>
 #include <modest-header-window.h>
 #include <modest-folder-window.h>
index 62ea589..a47c522 100644 (file)
@@ -288,7 +288,7 @@ modest_gtkhtml_mime_part_view_init (ModestGtkhtmlMimePartView *self)
        gtk_html_set_blocking        (GTK_HTML(self), TRUE);
        gtk_html_set_images_blocking (GTK_HTML(self), TRUE);
        /* We don't need this for Hildon2 as this widget will be most
-          likely inside pannable area */
+          likely inside scrollable area */
 #ifndef MODEST_TOOLKIT_HILDON2
 #ifndef MODEST_TOOLKIT_GTK
         gtk_html_set_auto_panning    (GTK_HTML (self), TRUE);