[maemo-commits] [maemo-commits] r9352 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Jan 25 18:25:25 EET 2007
Author: moimart
Date: 2007-01-25 18:25:24 +0200 (Thu, 25 Jan 2007)
New Revision: 9352

Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c
Log:

	* libhildondesktop/hildon-desktop-panel-window-dialog.c:
        * libhildondesktop/hildon-desktop-panel-expandable.c:
        - Fixed orientation of panel container.
	* ChangeLog updated.



Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-01-25 15:57:42 UTC (rev 9351)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-01-25 16:25:24 UTC (rev 9352)
@@ -1,5 +1,11 @@
 2007-01-24  Moises Martinez  <moises.martinez at nokia.com>
 
+	* libhildondesktop/hildon-desktop-panel-window-dialog.c:
+	* libhildondesktop/hildon-desktop-panel-expandable.c:
+	- Fixed orientation of panel container.
+
+2007-01-24  Moises Martinez  <moises.martinez at nokia.com>
+
 	* libhildondesktop/hildon-desktop-panel-window-dialog.[ch]:
 	- Added new panel window with dialog hint
 

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c	2007-01-25 15:57:42 UTC (rev 9351)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c	2007-01-25 16:25:24 UTC (rev 9352)
@@ -298,20 +298,32 @@
 
   if (n_rows > table_rows)
   {
-    gtk_table_resize (panel->priv->extension_table,
-		      n_rows,
-		      panel->priv->items_p_row);
+    if (HILDON_DESKTOP_PANEL (panel)->orient == GTK_ORIENTATION_HORIZONTAL)
+      gtk_table_resize (panel->priv->extension_table,
+		        n_rows,
+		        panel->priv->items_p_row);
+    else
+      gtk_table_resize (panel->priv->extension_table,
+		        panel->priv->items_p_row,
+		        n_rows);
   }
 
-  top_attach    = n_rows-1;
-  bottom_attach = n_rows;
+  if (1)/*HILDON_DESKTOP_PANEL (panel)->orient == GTK_ORIENTATION_HORIZONTAL)*/
+  {	  
+    top_attach    = n_rows-1;
+    bottom_attach = n_rows;
 
-  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);
+    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);
 
-  right_attach = left_attach + 1;
+    right_attach = left_attach + 1;
+  }
+  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),
@@ -433,7 +445,7 @@
     if (HILDON_DESKTOP_PANEL (panel)->orient == GTK_ORIENTATION_VERTICAL)
     {
       if (p_x != 0) 
-	_offset *= -1;
+	_offset *= -4;
       
       gtk_window_move (panel->priv->extension_window, p_x + p_width*_offset,p_y);
     }
@@ -446,8 +458,6 @@
     }
 	  
     gtk_widget_show (GTK_WIDGET (panel->priv->extension_window));
-
-    /*TODO: Positioning and sizing of the window */
   }
   else
   {

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c	2007-01-25 15:57:42 UTC (rev 9351)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c	2007-01-25 16:25:24 UTC (rev 9352)
@@ -101,6 +101,7 @@
   GObject *object;
   HildonDesktopPanelWindowDialog *window;
   GtkWidget *widget;
+  gint orientation;
   
   object = G_OBJECT_CLASS (hildon_desktop_panel_window_dialog_parent_class)->constructor (gtype,
 		  				                                   	  n_params,
@@ -120,10 +121,23 @@
   gtk_widget_push_composite_child ();
 
   HILDON_DESKTOP_WINDOW (window)->container = 
-    g_object_new (HILDON_DESKTOP_TYPE_PANEL_EXPANDABLE, "items_row", 7 ,NULL);
+    g_object_new (HILDON_DESKTOP_TYPE_PANEL_EXPANDABLE, "items_row", 3,NULL);
 
   gtk_container_add (GTK_CONTAINER (window),
 		     GTK_WIDGET (HILDON_DESKTOP_WINDOW (window)->container));
+
+  g_object_get (object,"orientation",&orientation,NULL);
+
+  if (orientation & HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_HORIZONTAL)
+    g_object_set (G_OBJECT (HILDON_DESKTOP_WINDOW (window)->container),
+		  "orientation",
+		  GTK_ORIENTATION_HORIZONTAL,
+		  NULL);
+  else
+    g_object_set (G_OBJECT (HILDON_DESKTOP_WINDOW (window)->container),
+		  "orientation",
+		  GTK_ORIENTATION_VERTICAL,
+		  NULL);
   
   gtk_widget_show (GTK_WIDGET (HILDON_DESKTOP_WINDOW (window)->container));
 


More information about the maemo-commits mailing list