Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r1725 -
      trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src
      ([EMAIL PROTECTED])
   2. r1726 - trunk/src/target/OM-2007/openmoko-libs/libmokoui
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: mickey
Date: 2007-04-11 01:37:37 +0200 (Wed, 11 Apr 2007)
New Revision: 1725

Modified:
   trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
Log:
openmoko-stylus-demo: no longer use MokoNavigationList, this widget is 
deprecated and will be gone soon


Modified: trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
===================================================================
--- trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c      
2007-04-10 23:37:04 UTC (rev 1724)
+++ trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c      
2007-04-10 23:37:37 UTC (rev 1725)
@@ -22,7 +22,7 @@
 #include <libmokoui/moko-dialog-window.h>
 #include <libmokoui/moko-paned-window.h>
 #include <libmokoui/moko-tool-box.h>
-#include <libmokoui/moko-navigation-list.h>
+#include <libmokoui/moko-tree-view.h>
 
 #include <gtk/gtkactiongroup.h>
 #include <gtk/gtkbutton.h>
@@ -102,7 +102,6 @@
 
     gtk_tree_view_column_set_sort_column_id(column, 0);
     moko_tree_view_append_column(clist, column);
-    //gtk_tree_view_column_set_min_width(column, 142);
 
     renderer = gtk_cell_renderer_text_new();
 
@@ -114,7 +113,6 @@
 
     gtk_tree_view_column_set_sort_column_id(column, 1);
     moko_tree_view_append_column(clist, column);
-    //gtk_tree_view_column_set_min_width(column, 156);
 }
 
 void cb_searchbox_visible(MokoToolBox* toolbox, gpointer user_data)
@@ -298,17 +296,12 @@
     /* navigation area */
     //GtkLabel* navigation = gtk_label_new( "Add your widget for 
navigating\nthrough appplication specific\ndata here" );
 
-    MokoTreeView *moko_treeview;
+    MokoTreeView *moko_treeview = moko_tree_view_new();
     GtkTreeModel *model = create_model ();
-    MokoNavigationList *moko_navigation_list;
-
-    moko_navigation_list = moko_navigation_list_new();
-    moko_treeview = moko_navigation_list_get_tree_view (moko_navigation_list);
     gtk_tree_view_set_model (moko_treeview, GTK_TREE_MODEL (model) );
     clist_insert(moko_treeview);
 
-    //moko_paned_window_set_upper_pane( window, GTK_WIDGET(navigation) );
-    moko_paned_window_set_upper_pane( window, GTK_WIDGET(moko_navigation_list) 
);
+    moko_paned_window_set_upper_pane( window, 
GTK_WIDGET(moko_tree_view_put_into_scrolled_window(moko_treeview)) );
 
     GtkButton* button1;
     GtkButton* button2;




--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-11 02:02:49 +0200 (Wed, 11 Apr 2007)
New Revision: 1726

Modified:
   trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-tree-view.c
Log:
MokoTreeView: fix problem layed out in last commit log.
Remaining issue: make the MokoTreeView only to allocate its size based on a 
grid, i.e. a whole-number factor of the row height


Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-tree-view.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-tree-view.c   
2007-04-10 23:37:37 UTC (rev 1725)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-tree-view.c   
2007-04-11 00:02:49 UTC (rev 1726)
@@ -96,7 +96,7 @@
 
 }
 
-GtkWidget* moko_tree_view_put_into_scrolled_window(MokoTreeView* self)
+_moko_tree_view_adjustment_changed(GtkAdjustment* adj, MokoTreeView* self)
 {
     // compute value for vadjustment
     gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(self), TRUE );
@@ -108,18 +108,27 @@
     gint cr_height;
     gtk_tree_view_column_cell_get_size( first_column, NULL, &cr_x_offset, 
&cr_y_offset, &cr_width, &cr_height );
 
+    //FIXME why does it need the +2 ?
+    if ( adj->step_increment != cr_height+2 )
+        adj->step_increment = cr_height+2;
+    gint pageinc = cr_height * ( ( adj->page_size / cr_height ) -1 );
+    if ( adj->page_increment != pageinc )
+        adj->page_increment = pageinc;
+
+    g_debug( "new vadjustment step increment = %f", adj->step_increment );
+    g_debug( "new vadjustment page increment = %f", adj->page_increment );
+    g_debug( "new vadjustment page size = %f", adj->page_size );
+
+}
+
+GtkWidget* moko_tree_view_put_into_scrolled_window(MokoTreeView* self)
+{
     GtkWidget* scrolledwindow = gtk_scrolled_window_new( NULL, NULL );
     //FIXME get from style or (even better) set as initial size hint in 
MokoPanedWindow (also via style sheet of course)
     gtk_widget_set_size_request( scrolledwindow, 0, 170 );
     gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scrolledwindow), 
GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
     gtk_container_add( GTK_CONTAINER(scrolledwindow), GTK_WIDGET(self) );
-
-    //FIXME this doesn't work :/ the idea is to set the step and page 
increment, so that we never scroll
-    //to anything else but a fully visible entry (as opposed to half way 
visible)
-    GtkAdjustment* vadjustment = gtk_tree_view_get_vadjustment( 
GTK_TREE_VIEW(self) );
-    g_debug( "vadjustment page increment = %d", vadjustment->page_increment );
-    vadjustment->step_increment = 1;
-    vadjustment->page_increment = 1;
-    vadjustment->page_size = 1;
+    GtkAdjustment* adj = gtk_scrolled_window_get_vadjustment( 
GTK_SCROLLED_WINDOW(scrolledwindow) );
+    g_signal_connect( G_OBJECT(adj), "changed", 
G_CALLBACK(_moko_tree_view_adjustment_changed), self );
     return scrolledwindow;
 }




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to