diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-10-29 17:40:36 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-10-29 17:40:36 +0000 |
commit | 25e9b79f5c944837192186c733feb4a3a311a051 (patch) | |
tree | 27664e6ba318748d7bdca4d631f158335387be06 /amiga | |
parent | 802f58f10d1d733093b0c285a2ee8bfdf68de414 (diff) | |
download | netsurf-25e9b79f5c944837192186c733feb4a3a311a051.tar.gz netsurf-25e9b79f5c944837192186c733feb4a3a311a051.tar.bz2 |
Allow getting the tree's drag property. This ensures we can see whether the current
drag is something we might need to display an icon for.
svn path=/trunk/netsurf/; revision=10917
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/download.c | 2 | ||||
-rwxr-xr-x | amiga/tree.c | 20 |
2 files changed, 18 insertions, 4 deletions
diff --git a/amiga/download.c b/amiga/download.c index 15a0286d5..370fbbc42 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -512,7 +512,7 @@ void ami_drag_icon_show(struct Window *win, char *type) ami_update_pointer(win, GUI_POINTER_DEFAULT); } - if(type == "drawer") deftype = WBDRAWER; + if(!strcmp(type, "drawer")) deftype = WBDRAWER; dobj = GetIconTags(NULL, ICONGETA_GetDefaultName, type, ICONGETA_GetDefaultType, deftype, diff --git a/amiga/tree.c b/amiga/tree.c index 7b91b78e9..c71e05d64 100755 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -265,6 +265,19 @@ void ami_tree_scroll(struct treeview_window *twin, int sx, int sy) ami_tree_draw(twin); } +void ami_tree_drag_icon_show(struct treeview_window *twin) +{ + if(tree_node_is_folder( + tree_get_selected_node( + tree_get_root(twin->tree)))) + { + ami_drag_icon_show(twin->win, "drawer"); + } + else + { + ami_drag_icon_show(twin->win, "html"); + } +} void ami_tree_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg) { @@ -688,8 +701,6 @@ BOOL ami_tree_event(struct treeview_window *twin) { int drag_x_move = 0, drag_y_move = 0; - /* TODO: Show drag icons on TREE_MOVE_DRAG start. - * Until then, the below line does nothing. */ ami_drag_icon_move(); if(twin->win->MouseX < bbox->Left) @@ -718,7 +729,8 @@ BOOL ami_tree_event(struct treeview_window *twin) BROWSER_MOUSE_DRAG_ON; if(twin->drag_x == 0) twin->drag_x = x; if(twin->drag_y == 0) twin->drag_y = y; - + if(tree_drag_status(twin->tree) == TREE_MOVE_DRAG) + ami_tree_drag_icon_show(twin); } else if(twin->mouse_state & BROWSER_MOUSE_PRESS_2) { @@ -728,6 +740,8 @@ BOOL ami_tree_event(struct treeview_window *twin) BROWSER_MOUSE_DRAG_ON; if(twin->drag_x == 0) twin->drag_x = x; if(twin->drag_y == 0) twin->drag_y = y; + if(tree_drag_status(twin->tree) == TREE_MOVE_DRAG) + ami_tree_drag_icon_show(twin); } else { |