summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-07-29 21:41:25 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-07-29 21:41:25 +0000
commit0522be76abc8f189b298b3ce01969fcbf05b8764 (patch)
treed75bfc582ccda46f0ef45087cce1e567ba52ef75 /amiga
parent95a6de5f7ec07fd9fe11c1bd877dbd84353705bc (diff)
downloadnetsurf-0522be76abc8f189b298b3ce01969fcbf05b8764.tar.gz
netsurf-0522be76abc8f189b298b3ce01969fcbf05b8764.tar.bz2
Add option to control whether drags have icons or just a pointer change.
svn path=/trunk/netsurf/; revision=10672
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/dist/NetSurf.guide1
-rw-r--r--amiga/download.c34
-rw-r--r--amiga/options.h5
-rw-r--r--amiga/theme.c2
4 files changed, 28 insertions, 14 deletions
diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide
index 39304a131..799136567 100755
--- a/amiga/dist/NetSurf.guide
+++ b/amiga/dist/NetSurf.guide
@@ -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
diff --git a/amiga/download.c b/amiga/download.c
index b807f975e..f9ea96194 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -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;
}
diff --git a/amiga/options.h b/amiga/options.h
index 4d2e0fdca..b1b508fe5 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -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
diff --git a/amiga/theme.c b/amiga/theme.c
index afef14887..3ac37c12d 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -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)
{