Author: chris_y
Date: Thu Jul 29 16:41:25 2010
New Revision: 10672
URL:
http://source.netsurf-browser.org?rev=10672&view=rev
Log:
Add option to control whether drags have icons or just a pointer change.
Modified:
trunk/netsurf/amiga/dist/NetSurf.guide
trunk/netsurf/amiga/download.c
trunk/netsurf/amiga/options.h
trunk/netsurf/amiga/theme.c
Modified: trunk/netsurf/amiga/dist/NetSurf.guide
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/dist/NetSurf.guide?...
==============================================================================
--- trunk/netsurf/amiga/dist/NetSurf.guide (original)
+++ trunk/netsurf/amiga/dist/NetSurf.guide Thu Jul 29 16:41:25 2010
@@ -41,6 +41,7 @@
@{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
Modified: trunk/netsurf/amiga/download.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/download.c?rev=1067...
==============================================================================
--- trunk/netsurf/amiga/download.c (original)
+++ trunk/netsurf/amiga/download.c Thu Jul 29 16:41:25 2010
@@ -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 @@
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 @@
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 @@
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;
@@ -502,6 +500,16 @@
long format = 0;
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;
@@ -543,6 +551,8 @@
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_close(struct Window *win)
{
- CloseWindow(win);
+ if(win) CloseWindow(win);
drag_icon = NULL;
}
Modified: trunk/netsurf/amiga/options.h
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/options.h?rev=10672...
==============================================================================
--- trunk/netsurf/amiga/options.h (original)
+++ trunk/netsurf/amiga/options.h Thu Jul 29 16:41:25 2010
@@ -49,6 +49,7 @@
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_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 @@
{ "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
Modified: trunk/netsurf/amiga/theme.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/theme.c?rev=10672&a...
==============================================================================
--- trunk/netsurf/amiga/theme.c (original)
+++ trunk/netsurf/amiga/theme.c Thu Jul 29 16:41:25 2010
@@ -191,7 +191,7 @@
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)
{