diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-11-03 21:00:07 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-11-03 21:00:07 +0000 |
commit | ea57818977b3db160f6de028a490462aa317b294 (patch) | |
tree | dbe3735d53a4e4ee153ccbc2d189b5553a732a47 | |
parent | afd0dbcfad68b919d68fb14fbb44defeb42fac5b (diff) | |
download | netsurf-ea57818977b3db160f6de028a490462aa317b294.tar.gz netsurf-ea57818977b3db160f6de028a490462aa317b294.tar.bz2 |
Show correct drag icons
svn path=/trunk/netsurf/; revision=10939
-rwxr-xr-x | amiga/tree.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/amiga/tree.c b/amiga/tree.c index a7f86035a..155f645b4 100755 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -49,6 +49,7 @@ #include "desktop/cookies.h" #include "desktop/history_global_core.h" #include "desktop/hotlist.h" +#include "desktop/tree_url_node.h" #include "amiga/sslcert.h" #include "amiga/drag.h" /* drag icon stuff */ #include "amiga/theme.h" /* pointers */ @@ -235,6 +236,11 @@ void ami_tree_scroll(struct treeview_window *twin, int sx, int sy) void ami_tree_drag_icon_show(struct treeview_window *twin) { + const char *type = "project"; + const char *url; + struct url_data *data; + struct node *node = NULL; + if((tree_drag_status(twin->tree) == TREE_NO_DRAG) || (tree_drag_status(twin->tree) == TREE_SELECT_DRAG)) return; @@ -242,15 +248,22 @@ void ami_tree_drag_icon_show(struct treeview_window *twin) if((twin->type == AMI_TREE_COOKIES) || (twin->type == AMI_TREE_SSLCERT)) return; /* No permissable drag operations */ - if(tree_node_is_folder( - tree_get_selected_node( - tree_get_root(twin->tree)))) + node = tree_get_selected_node(tree_get_root(twin->tree)); + + if(node && tree_node_is_folder(node)) { ami_drag_icon_show(twin->win, "drawer"); } else { - ami_drag_icon_show(twin->win, "html"); + if(node && (url = tree_url_node_get_url(node))) + { + if(data = urldb_get_url_data(url)) + { + type = ami_content_type_to_file_type(data->type); + } + } + ami_drag_icon_show(twin->win, type); } } |