[maemo-commits] [maemo-commits] r10841 - in projects/haf/trunk/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Mar 29 19:39:29 EEST 2007
Author: moimart
Date: 2007-03-29 19:39:28 +0300 (Thu, 29 Mar 2007)
New Revision: 10841

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c
Log:

	* libhildondesktop/hildon-desktop-panel-expandable.c:
        - Fixed size of items in extension table.
	* ChangeLog updated.



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-03-29 14:24:36 UTC (rev 10840)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-03-29 16:39:28 UTC (rev 10841)
@@ -1,3 +1,8 @@
+2007-03-29  Moises Martinez  <moises.martinez at nokia.com>
+
+	* libhildondesktop/hildon-desktop-panel-expandable.c:
+	- Fixed size of items in extension table.
+
 2007-03-29  Johan Bilien  <johan.bilien at nokia.com>
 
 	* libhildondesktop/hildon-desktop-home-item.[ch]:

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c	2007-03-29 14:24:36 UTC (rev 10840)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c	2007-03-29 16:39:28 UTC (rev 10841)
@@ -189,6 +189,7 @@
 					      (GDestroyNotify) g_free,
 					      (GDestroyNotify) gtk_widget_destroy);
 
+
   panel->priv->queued_items = NULL;
   panel->priv->extension_opened = FALSE;
   panel->priv->extension_table = NULL;
@@ -222,6 +223,12 @@
 
   panel->priv->extension_table = GTK_TABLE (gtk_table_new (1,panel->priv->items_p_row,TRUE));
 
+  g_object_set (panel->priv->extension_table,
+		"homogeneous", TRUE,
+	        "row-spacing", 0,
+		"column-spacing", 0,
+		NULL);	
+
   gtk_container_add (GTK_CONTAINER (panel->priv->extension_window),
 		     GTK_WIDGET (panel->priv->extension_table));
 
@@ -349,15 +356,17 @@
 
   g_debug ("Adding button in expandable %d %d",ex_panel->priv->items_p_row,ex_panel->priv->n_items+1);
 
-  gtk_widget_size_request (button, &req);
+  req.width  = button->requisition.width;
+  req.height = button->requisition.height;
   
   g_object_get (G_OBJECT (panel), "item_width", &item_width, "item_height", &item_height, NULL);
-
+  
   if (req.width > item_width)
     item_width = req.width;
-	  
+  
   gtk_widget_set_size_request (button, item_width, item_height);
-
+  gtk_widget_set_size_request (GTK_BIN (button)->child, item_width, item_height);
+  
   g_signal_connect (button,
 		    "destroy",
 		    G_CALLBACK (hildon_desktop_panel_expandable_button_destroyed),
@@ -383,7 +392,6 @@
   }
   else
   {
-   
     if (STATUSBAR_IS_ITEM (button) && !STATUSBAR_ITEM (button)->condition)
       g_debug ("Statusbar: Item not visible %s",HILDON_DESKTOP_ITEM (button)->id);
     else
@@ -430,7 +438,7 @@
 	
   g_object_get (panel->priv->extension_table, "n-rows", &table_rows, NULL);
 
-  if (n_rows > table_rows)
+  if (n_rows+1 > table_rows)
   {
     if (HILDON_DESKTOP_PANEL (panel)->orient == GTK_ORIENTATION_HORIZONTAL)
       gtk_table_resize (panel->priv->extension_table,
@@ -450,21 +458,22 @@
     if ((panel->priv->n_items % panel->priv->items_p_row) == 0)
       left_attach = 0;
     else 
-      left_attach = (((panel->priv->n_items+1) % panel->priv->items_p_row)+1);
+      left_attach = (((panel->priv->n_items+1) % panel->priv->items_p_row)) - 1;
 
     right_attach = left_attach + 1;
+
+    g_debug ("left attach %d right attach %d top attach %d b attach %d",
+	     left_attach,right_attach,top_attach,bottom_attach);
   }
   else
   {
     /*TODO:  g_debug ("l: %d, r: %d, t:%d, b: %d",left_attach,right_attach,top_attach,bottom_attach);*/
   }
 
-  gtk_table_attach (panel->priv->extension_table,
-		    GTK_WIDGET (item),
-		    left_attach, right_attach,
-		    top_attach, bottom_attach,
-		    GTK_SHRINK, GTK_SHRINK,
-		    0,0);
+  gtk_table_attach_defaults (panel->priv->extension_table,
+		    	     GTK_WIDGET (item),
+		             left_attach, right_attach,
+		             top_attach, bottom_attach);
 
   panel->priv->n_items++;
 }


More information about the maemo-commits mailing list