r1839 - in trunk/src/target/OM-2007/openmoko-libs: . libmokoui

rob at sita.openmoko.org rob at sita.openmoko.org
Wed Apr 25 17:42:27 CEST 2007


Author: rob
Date: 2007-04-25 17:42:26 +0200 (Wed, 25 Apr 2007)
New Revision: 1839

Modified:
   trunk/src/target/OM-2007/openmoko-libs/ChangeLog
   trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.c
Log:
2007-04-25  Rob Bradford  <rob at openedhand.com>

	* libmokoui/moko-paned-window.c: (moko_paned_window_init),
	(moko_paned_window_set_ratio):
	Improve the moko_paned_window_set_ratio function. It's just the ratio
	of the top half (including menu area and toolbox) to the bottom half.
	No need to be try and be clever about considering the menu and toolbox
	because its not clear what the ratio means in that case.
	Set a default ratio of 1:1.



Modified: trunk/src/target/OM-2007/openmoko-libs/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/ChangeLog	2007-04-25 14:29:30 UTC (rev 1838)
+++ trunk/src/target/OM-2007/openmoko-libs/ChangeLog	2007-04-25 15:42:26 UTC (rev 1839)
@@ -1,5 +1,15 @@
 2007-04-25  Rob Bradford  <rob at openedhand.com>
 
+	* libmokoui/moko-paned-window.c: (moko_paned_window_init),
+	(moko_paned_window_set_ratio):
+	Improve the moko_paned_window_set_ratio function. It's just the ratio
+	of the top half (including menu area and toolbox) to the bottom half.
+	No need to be try and be clever about considering the menu and toolbox
+	because its not clear what the ratio means in that case.
+	Set a default ratio of 1:1.
+
+2007-04-25  Rob Bradford  <rob at openedhand.com>
+
 	* libmokoui/moko-scrolled-pane.c:
 	(moko_scrolled_pane_pack_with_viewport):
 	* libmokoui/moko-scrolled-pane.h:

Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.c	2007-04-25 14:29:30 UTC (rev 1838)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.c	2007-04-25 15:42:26 UTC (rev 1839)
@@ -86,6 +86,8 @@
     gtk_paned_add2( GTK_PANED(priv->outerframe), priv->lower );
     priv->menubox = NULL;
     priv->toolbox = NULL;
+
+    moko_paned_window_set_ratio (self, 50);
 }
 
 GtkWidget* moko_paned_window_new() /* Construction */
@@ -136,9 +138,11 @@
 {
     MokoPanedWindowPriv* priv = MOKO_PANED_WINDOW_GET_PRIVATE(self);
     moko_debug( "moko_paned_window_set_ratio" );
-    //FIXME calculate this correctly, need to subtract the height of tool box and menu box
-    //      which is probably not 120 ;-)
-    gtk_paned_set_position( GTK_PANED(priv->outerframe), ratio*(gdk_screen_height()-120)/100 );
+    guint height;
+
+    gtk_window_get_size (GTK_WIDGET (self), NULL, &height);
+
+    gtk_paned_set_position( GTK_PANED(priv->outerframe), ratio * height / 100 );
 }
 
 void moko_paned_window_set_navigation_pane(MokoPanedWindow* self, GtkWidget* child)





More information about the commitlog mailing list