[maemo-commits] [maemo-commits] r10920 - in projects/haf/trunk/hildon-desktop: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Apr 2 19:06:07 EEST 2007
Author: jobi
Date: 2007-04-02 19:06:04 +0300 (Mon, 02 Apr 2007)
New Revision: 10920

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c
Log:

2007-04-02  Johan Bilien  <johan.bilien at nokia.com>

	* src/hn-app-switcher.c:
	- moved creation of the internal VBox from the constructor
	to the _orientation_changed. Fixes a warning



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-04-02 16:01:59 UTC (rev 10919)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-04-02 16:06:04 UTC (rev 10920)
@@ -1,3 +1,9 @@
+2007-04-02  Johan Bilien  <johan.bilien at nokia.com>
+
+	* src/hn-app-switcher.c:
+	- moved creation of the internal VBox from the constructor
+	to the _orientation_changed. Fixes a warning
+
 2007-04-02  Moises Martinez  <moises.martinez at nokia.com>
 
 	* configure.ac: Fixed typo in statusbardesktopentrydir

Modified: projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c	2007-04-02 16:01:59 UTC (rev 10919)
+++ projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c	2007-04-02 16:06:04 UTC (rev 10920)
@@ -1099,29 +1099,36 @@
 static void 
 hn_app_switcher_orientation_changed_cb (HNAppSwitcher *app_switcher) 
 {
-  GList *children,*iter;
-  
-  children = 
-    gtk_container_get_children (GTK_CONTAINER (app_switcher->box));
+  GList *children = NULL, *iter;
 
-  if (children == NULL) return;
-  else g_debug ("Changing orientation app_switcher");
+  g_debug ("orientation_changed");
   
+  if (GTK_IS_CONTAINER (app_switcher->box))
+    children = 
+        gtk_container_get_children (GTK_CONTAINER (app_switcher->box));
+  
   for (iter = children; iter; iter = g_list_next (iter))
   {	  
     g_object_ref (G_OBJECT (iter->data));
     gtk_container_remove (GTK_CONTAINER (app_switcher->box),GTK_WIDGET (iter->data));
   }
 
-  gtk_container_remove (GTK_CONTAINER (app_switcher),GTK_WIDGET (app_switcher->box)); 
+  if (GTK_IS_WIDGET (app_switcher->box))
+      gtk_container_remove (GTK_CONTAINER (app_switcher),GTK_WIDGET (app_switcher->box)); 
 
+  gtk_widget_push_composite_child ();
   if (HILDON_DESKTOP_PANEL_ITEM (app_switcher)->orientation == GTK_ORIENTATION_HORIZONTAL) 
     app_switcher->box = GTK_BOX (gtk_hbox_new (FALSE, 0));
   else
     app_switcher->box = GTK_BOX (gtk_vbox_new (FALSE, 0));
 
   gtk_container_add (GTK_CONTAINER (app_switcher),GTK_WIDGET (app_switcher->box));
+  gtk_widget_set_composite_name (GTK_WIDGET (app_switcher->box), "application-switcher-button-box");
+  
+  gtk_widget_show (GTK_WIDGET (app_switcher->box));
 
+  gtk_widget_pop_composite_child ();
+
   for (iter = children; iter; iter = g_list_next (iter))
   {
     gtk_container_add (GTK_CONTAINER (app_switcher->box),GTK_WIDGET (iter->data));
@@ -1132,7 +1139,8 @@
 
   queue_refresh_buttons (app_switcher);
 
-  g_list_free (children);
+  if (children)
+    g_list_free (children);
 }
 
 static void 
@@ -1202,20 +1210,6 @@
 
   gtk_widget_push_composite_child ();
 
-  /* inner box, used for padding */
-  g_debug ("Adding inner VBox");
-
-  if (HILDON_DESKTOP_PANEL_ITEM (app_switcher)->orientation == GTK_ORIENTATION_HORIZONTAL) 
-    app_switcher->box = GTK_BOX (gtk_hbox_new (FALSE, 0));
-  else
-    app_switcher->box = GTK_BOX (gtk_vbox_new (FALSE, 0));
-
-  gtk_widget_set_composite_name (GTK_WIDGET (app_switcher->box), "application-switcher-button-box");
-  
-  gtk_container_add (GTK_CONTAINER (app_switcher),GTK_WIDGET (app_switcher->box));
- 
-  gtk_widget_show (GTK_WIDGET (app_switcher->box));
-
   /* most recent applications buttons */
   g_debug ("Adding buttons");
 


More information about the maemo-commits mailing list