Support dragging from global history to hotlist
svn path=/trunk/netsurf/; revision=13219
This commit is contained in:
parent
8d685d7ac0
commit
ce37fdb128
|
@ -334,7 +334,7 @@ void ami_drag_selection(struct selection *s)
|
|||
char *utf8text;
|
||||
struct ami_text_selection *sel;
|
||||
struct IFFHandle *old_iffh = iffh;
|
||||
struct gui_window_2 *gwin = ami_window_at_pointer();
|
||||
struct gui_window_2 *gwin = ami_window_at_pointer(AMINS_WINDOW);
|
||||
|
||||
if(!gwin)
|
||||
{
|
||||
|
|
|
@ -276,7 +276,7 @@ BOOL ami_drag_in_progress(void)
|
|||
return drag_in_progress;
|
||||
}
|
||||
|
||||
struct gui_window_2 *ami_find_gwin_by_id(struct Window *win)
|
||||
void *ami_find_gwin_by_id(struct Window *win, int type)
|
||||
{
|
||||
struct nsObject *node, *nnode;
|
||||
struct gui_window_2 *gwin;
|
||||
|
@ -289,7 +289,7 @@ struct gui_window_2 *ami_find_gwin_by_id(struct Window *win)
|
|||
{
|
||||
nnode=(struct nsObject *)GetSucc((struct Node *)node);
|
||||
|
||||
if(node->Type == AMINS_WINDOW) // or frame?
|
||||
if(node->Type == type)
|
||||
{
|
||||
gwin = node->objstruct;
|
||||
if(win == gwin->win) return gwin;
|
||||
|
@ -299,7 +299,7 @@ struct gui_window_2 *ami_find_gwin_by_id(struct Window *win)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct gui_window_2 *ami_window_at_pointer(void)
|
||||
void *ami_window_at_pointer(int type)
|
||||
{
|
||||
struct Layer *layer;
|
||||
|
||||
|
@ -309,6 +309,6 @@ struct gui_window_2 *ami_window_at_pointer(void)
|
|||
|
||||
UnlockLayerInfo(&scrn->LayerInfo);
|
||||
|
||||
if(layer) return ami_find_gwin_by_id(layer->Window);
|
||||
if(layer) return ami_find_gwin_by_id(layer->Window, type);
|
||||
else return NULL;
|
||||
}
|
||||
|
|
|
@ -32,5 +32,5 @@ void ami_drag_icon_close(struct Window *win);
|
|||
void ami_drag_icon_move(void);
|
||||
BOOL ami_drag_in_progress(void);
|
||||
|
||||
struct gui_window_2 *ami_window_at_pointer(void);
|
||||
void *ami_window_at_pointer(int type);
|
||||
#endif
|
||||
|
|
17
amiga/tree.c
17
amiga/tree.c
|
@ -78,9 +78,9 @@ enum {
|
|||
|
||||
|
||||
struct treeview_window {
|
||||
struct nsObject *node;
|
||||
struct Window *win;
|
||||
Object *objects[GID_TREE_LAST];
|
||||
struct nsObject *node;
|
||||
int type;
|
||||
struct NewMenu *menu;
|
||||
char *menu_name[AMI_TREE_MENU_ITEMS];
|
||||
|
@ -289,12 +289,13 @@ void ami_tree_drag_icon_show(struct treeview_window *twin)
|
|||
void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
|
||||
{
|
||||
struct gui_window_2 *gwin;
|
||||
struct treeview_window *tw;
|
||||
struct node *selected_node;
|
||||
BOOL drag;
|
||||
|
||||
if(drag = ami_drag_in_progress()) ami_drag_icon_close(twin->win);
|
||||
|
||||
if(drag && (gwin = ami_window_at_pointer()))
|
||||
if(drag && (twin != ami_window_at_pointer(AMINS_TVWINDOW)))
|
||||
{
|
||||
selected_node = tree_get_selected_node(tree_get_root(twin->tree));
|
||||
|
||||
|
@ -304,8 +305,16 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
|
|||
}
|
||||
else
|
||||
{
|
||||
browser_window_go(gwin->bw, tree_url_node_get_url(selected_node),
|
||||
NULL, true);
|
||||
if(gwin = ami_window_at_pointer(AMINS_WINDOW))
|
||||
{
|
||||
browser_window_go(gwin->bw, tree_url_node_get_url(selected_node),
|
||||
NULL, true);
|
||||
}
|
||||
else if((tw = ami_window_at_pointer(AMINS_TVWINDOW)) &&
|
||||
(tw != twin) && (tw->type == AMI_TREE_HOTLIST))
|
||||
{
|
||||
hotlist_add_page_xy(tree_url_node_get_url(selected_node), x, y);
|
||||
}
|
||||
}
|
||||
tree_drag_end(twin->tree, twin->mouse_state,
|
||||
twin->drag_x, twin->drag_y,
|
||||
|
|
Loading…
Reference in New Issue