From cf539e40fda215156ad383ccf968ab615c0abf64 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 13 Sep 2012 14:02:28 +0000 Subject: [PATCH] efm no longer shows the drop target animation for targets that are not valid for dropping onto SVN revision: 76612 --- src/bin/e_fm.c | 82 ++++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index a2944056a..2ef96c21d 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -6107,64 +6107,66 @@ _e_fm2_cb_dnd_move(void *data, const char *type, void *event) e_drop_handler_action_set(ev->action); EINA_LIST_FOREACH(sd->icons, l, ic) { - if (E_INSIDE(dx, dy, ic->x - ic->sd->pos.x, ic->y - ic->sd->pos.y, ic->w, ic->h)) + if (!E_INSIDE(dx, dy, ic->x - ic->sd->pos.x, ic->y - ic->sd->pos.y, ic->w, ic->h)) continue; + if (ic->drag.dnd) continue; + if (!S_ISDIR(ic->info.statinfo.st_mode)) { - if (ic->drag.dnd) continue; - /* if list view */ - if (_e_fm2_view_mode_get(ic->sd) == E_FM2_VIEW_MODE_LIST) + if (ic->sd->drop_icon) + _e_fm2_dnd_drop_hide(sd->obj); + _e_fm2_dnd_drop_all_show(sd->obj); + return; + } + /* if list view */ + if (_e_fm2_view_mode_get(ic->sd) == E_FM2_VIEW_MODE_LIST) + { + /* if there is a .order file - we can re-order files */ + if (ic->sd->order_file) { - /* if there is a .order file - we can re-order files */ - if (ic->sd->order_file) + /* if dir: */ + if (!ic->sd->config->view.no_subdir_drop) { - /* if dir: */ - if ((S_ISDIR(ic->info.statinfo.st_mode)) && - (!ic->sd->config->view.no_subdir_drop)) + /* if bottom 25% or top 25% then insert between prev or next */ + /* if in middle 50% then put in dir */ + if (dy <= (ic->y - ic->sd->pos.y + (ic->h / 4))) { - /* if bottom 25% or top 25% then insert between prev or next */ - /* if in middle 50% then put in dir */ - if (dy <= (ic->y - ic->sd->pos.y + (ic->h / 4))) - { - _e_fm2_dnd_drop_show(ic, 0); - } - else if (dy > (ic->y - ic->sd->pos.y + ((ic->h * 3) / 4))) - { - _e_fm2_dnd_drop_show(ic, 1); - } - else - { - _e_fm2_dnd_drop_show(ic, -1); - } + _e_fm2_dnd_drop_show(ic, 0); + } + else if (dy > (ic->y - ic->sd->pos.y + ((ic->h * 3) / 4))) + { + _e_fm2_dnd_drop_show(ic, 1); } else { - /* if top 50% or bottom 50% then insert between prev or next */ - if (dy <= (ic->y - ic->sd->pos.y + (ic->h / 2))) - _e_fm2_dnd_drop_show(ic, 0); - else - _e_fm2_dnd_drop_show(ic, 1); + _e_fm2_dnd_drop_show(ic, -1); } } - /* if we are over subdirs or files */ else { - /* - * if it's over a dir - hilight as it will be dropped info - * FIXME: should there be a separate highlighting function for files? - * */ - if (!(S_ISDIR(ic->info.statinfo.st_mode)) || - (!ic->sd->config->view.no_subdir_drop)) - _e_fm2_dnd_drop_show(ic, -1); + /* if top 50% or bottom 50% then insert between prev or next */ + if (dy <= (ic->y - ic->sd->pos.y + (ic->h / 2))) + _e_fm2_dnd_drop_show(ic, 0); + else + _e_fm2_dnd_drop_show(ic, 1); } } + /* if we are over subdirs or files */ else { - /* if it's over a dir - hilight as it will be dropped in */ - if (!(S_ISDIR(ic->info.statinfo.st_mode)) || - (!ic->sd->config->view.no_subdir_drop)) + /* + * if it's over a dir - hilight as it will be dropped info + * FIXME: should there be a separate highlighting function for files? + * */ + if (!ic->sd->config->view.no_subdir_drop) _e_fm2_dnd_drop_show(ic, -1); } - return; } + else + { + /* if it's over a dir - hilight as it will be dropped in */ + if (!ic->sd->config->view.no_subdir_drop) + _e_fm2_dnd_drop_show(ic, -1); + } + return; } /* FIXME: not over icon - is it within the fm view? if so drop there */ if (E_INSIDE(dx, dy, 0, 0, sd->w, sd->h))