Add option to control whether drags have icons or just a pointer change.

svn path=/trunk/netsurf/; revision=10672
This commit is contained in:
Chris Young 2010-07-29 21:41:25 +00:00
parent 95a6de5f7e
commit 0522be76ab
4 changed files with 28 additions and 14 deletions

View File

@ -41,6 +41,7 @@ There are a couple of Amiga-specific options which can only be changed directly
@{b}kiosk_mode@{ub} No gadgets
@{b}no_iframes@{ub} Disable IFrames
@{b}printer_unit@{ub} Specifies which printer.device unit to print to
@{b}drag_save_icons@{ub} Enables displaying Workbench-style transparent icons under the pointer when performing drag saves (ctrl-drag of objects available if NetSurf is running on the Workbench screen) and text selection drags. If set to 0 the pointer style will change instead. OS 4.0 users may want to set this to 0 as icons will appear opaque and obscure the drop position.
@{b}url_file@{ub} Path to URL database file
@{b}hotlist_file@{ub} Path to Hotlist file

View File

@ -59,7 +59,7 @@
ULONG drag_icon_width;
ULONG drag_icon_height;
struct Window *ami_drag_icon_show(char *type, ULONG *x, ULONG *y);
struct Window *ami_drag_icon_show(struct gui_window *g, char *type, ULONG *x, ULONG *y);
void ami_drag_icon_close(struct Window *win);
struct gui_download_window *gui_download_window_create(download_context *ctx,
@ -337,11 +337,6 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
if(strcmp(option_use_pubscreen,"Workbench")) return;
gui_window_set_pointer(g,AMI_GUI_POINTER_DRAG);
drag_save_data = c;
drag_save_gui = g;
drag_save = type;
switch(type)
{
case GUI_SAVE_OBJECT_ORIG: // object
@ -363,16 +358,19 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
break;
}
drag_icon = ami_drag_icon_show(filetype, &drag_icon_width, &drag_icon_height);
drag_icon = ami_drag_icon_show(g, filetype, &drag_icon_width, &drag_icon_height);
drag_save_data = c;
drag_save_gui = g;
drag_save = type;
}
void gui_drag_save_selection(struct selection *s, struct gui_window *g)
{
gui_window_set_pointer(g,AMI_GUI_POINTER_DRAG);
drag_icon = ami_drag_icon_show(g, "ascii", &drag_icon_width, &drag_icon_height);
drag_save_data = s;
drag_save = GUI_SAVE_TEXT_SELECTION;
drag_icon = ami_drag_icon_show("ascii", &drag_icon_width, &drag_icon_height);
}
void ami_drag_save(struct Window *win)
@ -493,7 +491,7 @@ void ami_drag_save(struct Window *win)
ami_update_pointer(win,GUI_POINTER_DEFAULT);
}
struct Window *ami_drag_icon_show(char *type, ULONG *x, ULONG *y)
struct Window *ami_drag_icon_show(struct gui_window *g, char *type, ULONG *x, ULONG *y)
{
struct Window *win;
struct DiskObject *dobj = NULL;
@ -503,6 +501,16 @@ struct Window *ami_drag_icon_show(char *type, ULONG *x, ULONG *y)
int err = 0;
int deftype = WBPROJECT;
if(option_drag_save_icons == false)
{
gui_window_set_pointer(g, AMI_GUI_POINTER_DRAG);
return NULL;
}
else
{
gui_window_set_pointer(g, GUI_POINTER_DEFAULT);
}
if(type == "drawer") deftype = WBDRAWER;
dobj = GetIconTags(NULL, ICONGETA_GetDefaultName, type,
@ -543,6 +551,8 @@ struct Window *ami_drag_icon_show(char *type, ULONG *x, ULONG *y)
void ami_drag_icon_move(struct Window *win)
{
if(win == NULL) return;
ChangeWindowBox(win, scrn->MouseX - (drag_icon_width / 2),
scrn->MouseY - (drag_icon_height / 2),
drag_icon_width, drag_icon_height);
@ -550,7 +560,7 @@ void ami_drag_icon_move(struct Window *win)
void ami_drag_icon_close(struct Window *win)
{
CloseWindow(win);
if(win) CloseWindow(win);
drag_icon = NULL;
}

View File

@ -49,6 +49,7 @@ extern bool option_startup_no_window;
extern bool option_close_no_quit;
extern bool option_hide_docky_icon;
extern char *option_font_unicode;
extern bool option_drag_save_icons;
#define EXTRA_OPTION_DEFINE \
char *option_url_file = 0; \
@ -80,6 +81,7 @@ bool option_startup_no_window = false; \
bool option_close_no_quit = false; \
bool option_hide_docky_icon = false; \
char *option_font_unicode = 0; \
bool option_drag_save_icons = true; \
#define EXTRA_OPTION_TABLE \
{ "url_file", OPTION_STRING, &option_url_file }, \
@ -110,5 +112,6 @@ char *option_font_unicode = 0; \
{ "startup_no_window", OPTION_BOOL, &option_startup_no_window}, \
{ "close_no_quit", OPTION_BOOL, &option_close_no_quit}, \
{ "hide_docky_icon", OPTION_BOOL, &option_hide_docky_icon}, \
{ "font_unicode", OPTION_STRING, &option_font_unicode },
{ "font_unicode", OPTION_STRING, &option_font_unicode }, \
{ "drag_save_icons", OPTION_BOOL, &option_drag_save_icons},
#endif

View File

@ -191,7 +191,7 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
if(mouseptrcurrent == shape) return;
if(drag_save) return;
if(drag_save_data) return;
if(option_use_os_pointers)
{