Enlightenment CVS committal

Author  : moom
Project : e17
Module  : proto

Dir     : e17/proto/etk/src/lib


Modified Files:
        etk_tree2.c 


Log Message:
* [Tree2] Emit the "row_clicked" signal when a row is clicked


===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_tree2.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- etk_tree2.c 26 Dec 2006 14:51:23 -0000      1.4
+++ etk_tree2.c 2 Jan 2007 11:24:03 -0000       1.5
@@ -2430,6 +2430,12 @@
     * to allow the user to drag and drop several rows. The selection will be 
done on "key-up" */
    if (!row_object->row->selected || event.modifiers != ETK_MODIFIER_NONE)
       _etk_tree2_row_select(row_object->row->tree, row_object->row, 
event.modifiers);
+   
+   if (event.flags != ETK_MOUSE_NONE)
+   {
+      etk_signal_emit(_etk_tree2_signals[ETK_TREE2_ROW_CLICKED_SIGNAL], 
ETK_OBJECT(row_object->row->tree),
+         NULL, row_object->row, &event);
+   }
 }
 
 /* Called when the background of a row is released by the mouse */
@@ -2437,13 +2443,26 @@
 {
    Etk_Tree2_Row_Object *row_object;
    Etk_Event_Mouse_Up event;
+   int x, y, w, h;
    
    if (!(row_object = data) || !row_object->row)
       return;
    
+   evas_object_geometry_get(obj, &x, &y, &w, &h);
    etk_event_mouse_up_wrap(ETK_WIDGET(row_object->row->tree), event_info, 
&event);
-   if (row_object->row->selected && event.modifiers == ETK_MODIFIER_NONE)
-      _etk_tree2_row_select(row_object->row->tree, row_object->row, 
ETK_MODIFIER_NONE);
+   
+   /* We make sure the mouse button has been released over the row */
+   if (ETK_INSIDE(event.canvas.x, event.canvas.y, x, y, w, h))
+   {
+      if (row_object->row->selected && event.modifiers == ETK_MODIFIER_NONE)
+         _etk_tree2_row_select(row_object->row->tree, row_object->row, 
ETK_MODIFIER_NONE);
+      
+      if (event.flags == ETK_MOUSE_NONE)
+      {
+         etk_signal_emit(_etk_tree2_signals[ETK_TREE2_ROW_CLICKED_SIGNAL], 
ETK_OBJECT(row_object->row->tree),
+            NULL, row_object->row, &event);
+      }
+   }
 }
 
 /* Called when the expander of a row is released by the mouse */



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to