Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_tree2.c 


Log Message:
let the theme do the highlight

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -3 -r1.75 -r1.76
--- ewl_tree2.c 1 Apr 2007 17:03:08 -0000       1.75
+++ ewl_tree2.c 1 Apr 2007 23:06:40 -0000       1.76
@@ -5,7 +5,6 @@
 #include "ewl_cell.h"
 #include "ewl_check.h"
 #include "ewl_expansion.h"
-#include "ewl_highlight.h"
 #include "ewl_label.h"
 #include "ewl_paned.h"
 #include "ewl_row.h"
@@ -715,9 +714,12 @@
                ewl_callback_append(row, EWL_CALLBACK_CLICKED,  
                                        ewl_tree2_cb_row_clicked, node);
 
-               if (!model->highlight || model->highlight(data, i))
+               if (!model->highlight || model->highlight(data, i)) {
                        ewl_callback_append(row, EWL_CALLBACK_MOUSE_IN,
                                        ewl_tree2_cb_row_highlight, NULL);
+                       ewl_callback_append(row, EWL_CALLBACK_MOUSE_OUT,
+                                       ewl_tree2_cb_row_unhighlight, NULL);
+               }
 
                EWL_TREE2_NODE(node)->row = row;
                ewl_widget_show(row);
@@ -811,36 +813,23 @@
 ewl_tree2_cb_row_highlight(Ewl_Widget *w, void *ev __UNUSED__, 
                                                void *data __UNUSED__)
 {
-       Ewl_Widget *h;
-       
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
        DCHECK_TYPE("w", w, EWL_ROW_TYPE);
 
-       h = ewl_highlight_new();
-       ewl_highlight_follow_set(EWL_HIGHLIGHT(h), w);
-       ewl_container_child_append(EWL_CONTAINER(w), h);
-       ewl_widget_show(h);
-
-       ewl_callback_append(w, EWL_CALLBACK_MOUSE_OUT,
-                       ewl_tree2_cb_row_unhighlight, h);
+       ewl_widget_state_set(w, "highlight,on", EWL_STATE_TRANSIENT);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
 static void
-ewl_tree2_cb_row_unhighlight(Ewl_Widget *w, void *ev __UNUSED__, void *data)
+ewl_tree2_cb_row_unhighlight(Ewl_Widget *w, void *ev __UNUSED__, void *data 
__UNUSED__)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
-       DCHECK_PARAM_PTR("data", data);
        DCHECK_TYPE("w", w, EWL_ROW_TYPE);
-       DCHECK_TYPE("data", data, EWL_HIGHLIGHT_TYPE);
-
-       ewl_widget_destroy(EWL_WIDGET(data));
 
-       ewl_callback_del(w, EWL_CALLBACK_MOUSE_OUT,
-                               ewl_tree2_cb_row_unhighlight);
+       ewl_widget_state_set(w, "highlight,off", EWL_STATE_TRANSIENT);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }



-------------------------------------------------------------------------
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
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to