Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_filelist.c ewl_scrollpane.c Log Message: Allow the theme to specify the type of scrolling to use, and only change directories in the filelist if the actual icon is clicked. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -3 -r1.50 -r1.51 --- ewl_filelist.c 6 Jan 2008 19:17:12 -0000 1.50 +++ ewl_filelist.c 11 Feb 2008 03:00:31 -0000 1.51 @@ -1191,44 +1191,63 @@ ewl_filelist_cb_clicked(Ewl_Widget *w, void *ev, void *data __UNUSED__) { - Ewl_Event_Mouse_Down *event; + Ewl_Event_Mouse_Down *md; char *file, *t; + int i = 0; + Ewl_Widget *c; Ewl_Filelist *fl; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(w); DCHECK_PARAM_PTR(ev); - event = ev; + md = ev; fl = data; if (!ewl_mvc_selected_count_get(EWL_MVC(fl->controller))) DRETURN(DLEVEL_STABLE); /* Single clicks only */ - if (event->clicks != 2) + if (md->clicks != 2) + { ewl_filelist_selected_files_change_notify(fl); + DRETURN(DLEVEL_STABLE); + } - /* Handle double clicks */ - if (event->clicks == 2) + /* Ensure that the click is on an icon, need to check for a + * highlight as the first click callback will create + */ + c = ewl_container_child_at_recursive_get(EWL_CONTAINER(fl), + md->base.x, md->base.y); + while (c && c->parent) { - file = ewl_filelist_selected_file_get(fl); - - /* If .. */ - if (!strcmp(file, fl->directory)) + if (ewl_widget_type_is(c, "highlight")) { - t = ecore_file_dir_get(fl->directory); - ewl_filelist_directory_set(fl, t); - FREE(t); + i = 1; + break; } - /* Change dir if dir, else call above */ - else if (ecore_file_is_dir(file)) - ewl_filelist_directory_set(fl, file); - - /* Send signal of file selected */ - else - ewl_filelist_selected_files_change_notify(fl); + c = c->parent; + } + + if (!i) + DRETURN(DLEVEL_STABLE); + + /* Handle double clicks */ + file = ewl_filelist_selected_file_get(fl); + /* If .. */ + if (!strcmp(file, fl->directory)) + { + t = ecore_file_dir_get(fl->directory); + ewl_filelist_directory_set(fl, t); + FREE(t); } + /* Change dir if dir, else call above */ + else if (ecore_file_is_dir(file)) + ewl_filelist_directory_set(fl, file); + + /* Send signal of file selected */ + else + ewl_filelist_selected_files_change_notify(fl); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_scrollpane.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- ewl_scrollpane.c 7 Feb 2008 20:15:30 -0000 1.34 +++ ewl_scrollpane.c 11 Feb 2008 03:00:31 -0000 1.35 @@ -89,6 +89,8 @@ ewl_scrollpane_init(Ewl_Scrollpane *s) { Ewl_Widget *w; + const char *kst; + Ewl_Kinetic_Scroll type; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(s, FALSE); @@ -174,7 +176,17 @@ * Setup kinetic scrolling info here */ s->kinfo = NULL; - ewl_scrollpane_kinetic_scrolling_set(s, EWL_KINETIC_SCROLL_NONE); + + kst = ewl_theme_data_str_get(w, "/scrollpane/kscroll_type"); + + if (kst && !strcmp(kst, "embedded")) + type = EWL_KINETIC_SCROLL_EMBEDDED; + else if (kst && !strcmp(kst, "normal")) + type = EWL_KINETIC_SCROLL_NORMAL; + else + type = EWL_KINETIC_SCROLL_NONE; + + ewl_scrollpane_kinetic_scrolling_set(s, type); ewl_callback_append(w, EWL_CALLBACK_DESTROY, ewl_scrollpane_cb_destroy, NULL); ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs