[maemo-commits] [maemo-commits] r12730 - in projects/haf/trunk/hildon-1: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Jul 12 15:05:37 EEST 2007
Author: tko
Date: 2007-07-12 15:05:35 +0300 (Thu, 12 Jul 2007)
New Revision: 12730

Modified:
   projects/haf/trunk/hildon-1/ChangeLog
   projects/haf/trunk/hildon-1/src/hildon-time-picker.c
Log:
Split the contents of map to more appropriate functions

2007-07-12  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* src/hildon-time-picker.c (hildon_time_picker_class_init,
	hildon_time_picker_map, hildon_time_picker_realize,
	hildon_time_picker_style_set): Split the contents of map to more
	appropriate functions; set window decorations on realize and update
	arrows' size requisitions on style-set. Avoids unnecessary resizing.


Modified: projects/haf/trunk/hildon-1/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-1/ChangeLog	2007-07-12 12:03:40 UTC (rev 12729)
+++ projects/haf/trunk/hildon-1/ChangeLog	2007-07-12 12:05:35 UTC (rev 12730)
@@ -1,3 +1,11 @@
+2007-07-12  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* src/hildon-time-picker.c (hildon_time_picker_class_init,
+	hildon_time_picker_map, hildon_time_picker_realize,
+	hildon_time_picker_style_set): Split the contents of map to more
+	appropriate functions; set window decorations on realize and update
+	arrows' size requisitions on style-set. Avoids unnecessary resizing.
+
 2007-07-02  Xan Lopez <xan.lopez at nokia.com>
 
 	[1.0.10-2 release]

Modified: projects/haf/trunk/hildon-1/src/hildon-time-picker.c
===================================================================
--- projects/haf/trunk/hildon-1/src/hildon-time-picker.c	2007-07-12 12:03:40 UTC (rev 12729)
+++ projects/haf/trunk/hildon-1/src/hildon-time-picker.c	2007-07-12 12:05:35 UTC (rev 12730)
@@ -168,9 +168,13 @@
                                                  gpointer unused);
 
 static void
-hildon_time_picker_map                          (GtkWidget *widget);
+hildon_time_picker_realize                      (GtkWidget *widget);
 
 static void
+hildon_time_picker_style_set                    (GtkWidget *widget,
+                                                 GtkStyle *previous_style);
+
+static void
 frame_size_request                              (GtkWidget *widget, 
                                                  GtkRequisition *requistion);
 
@@ -233,7 +237,8 @@
     gobject_class->finalize = hildon_time_picker_finalize;
     gobject_class->get_property = hildon_time_picker_get_property;
     gobject_class->set_property = hildon_time_picker_set_property;
-    widget_class->map = hildon_time_picker_map;
+    widget_class->realize = hildon_time_picker_realize;
+    widget_class->style_set = hildon_time_picker_style_set;
 
     /**
      * HildonTimePicker:minutes:
@@ -534,15 +539,24 @@
 }
 
 static void
-hildon_time_picker_map                          (GtkWidget *widget)
+hildon_time_picker_realize                      (GtkWidget *widget)
 {
+    GTK_WIDGET_CLASS (parent_class)->realize(widget);
+
+    /* We only want the border for the dialog. */
+    gdk_window_set_decorations (widget->window, GDK_DECOR_BORDER);
+}
+
+static void
+hildon_time_picker_style_set                    (GtkWidget *widget,
+                                                 GtkStyle *previous_style)
+{
     guint width, height;
     gint i, button;
     HildonTimePickerPrivate *priv = HILDON_TIME_PICKER_GET_PRIVATE (widget);
     g_assert (priv);
 
-    /* Widget is now mapped. Set border for the dialog. */
-    gdk_window_set_decorations (widget->window, GDK_DECOR_BORDER);
+    GTK_WIDGET_CLASS (parent_class)->style_set(widget, previous_style);
 
     /* Update hour/minute up/down buttons sizes from style properties */
     gtk_widget_style_get (widget,
@@ -559,8 +573,6 @@
             }
         }
     }
-
-    GTK_WIDGET_CLASS (parent_class)->map(widget);
 }
 
 /* 


More information about the maemo-commits mailing list