Make "resize with contents" a user option

This commit is contained in:
Chris Young 2013-04-10 19:36:38 +01:00
parent b086d04d8a
commit a938b1a337
3 changed files with 12 additions and 2 deletions

View File

@ -124,6 +124,8 @@ There are a couple of Amiga-specific options which can only be changed directly
@{b}cairo_renderer@{ub} Set rendering engine. -1 = palette-mapped (set automatically when required), 0 = graphics.library (default), 1 = Cairo/graphics.library mixed, 2 = Full Cairo.
@{b}monitor_aspect_x@{ub}/@{b}monitor_aspect_y@{ub} Correct aspect ratio for displays (default of 0 means "assume square pixels").
@{b}screen_compositing@{ub} Use compositing on NetSurf's own screen. 0=disable, 1=enable, 2=default (NB: This is indirectly modified by changing the "simple refresh" option in the GUI)
@{b}resize_with_contents@{ub} Set to 1 to respect GUI prefs' "resize with contents" option. Default is to use old-style "resize on release"
@{b}reformat_delay@{ub} Sets a delay on performing content reformats (eg. if the window has been resized). Set to a higher value to make "resize with contents" more responsive. Defaults to 0 (immediate).
@{b}redraw_tile_size_x@{ub}/@{b}redraw_tile_size_y@{ub} Specify the size of the off-screen bitmap. Higher will speed up redraws at the expense of memory. 0 disables tiling (will use a bitmap at least the size of the screen NetSurf is running on)
@{b}web_search_width@{ub} Defaults to 0. Larger values will increase the size of the web search gadget next to the URL bar.

View File

@ -3058,10 +3058,12 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
char addtab[100],addtab_s[100],addtab_g[100];
char tabthrobber[100];
ULONG refresh_mode = WA_SmartRefresh;
ULONG idcmp_sizeverify = IDCMP_SIZEVERIFY;
if (!scrn) ami_openscreenfirst();
if (nsoption_bool(kiosk_mode)) new_tab = false;
if (nsoption_bool(resize_with_contents)) idcmp_sizeverify = 0;
bw->scale = 1.0;
if(clone)
@ -3305,7 +3307,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
WA_SizeBBottom, TRUE,
WA_IDCMP, IDCMP_MENUPICK | IDCMP_MOUSEMOVE |
IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
IDCMP_RAWKEY | //IDCMP_SIZEVERIFY |
IDCMP_RAWKEY | idcmp_sizeverify |
IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
IDCMP_REFRESHWINDOW |
IDCMP_ACTIVEWINDOW | IDCMP_EXTENDEDMOUSE,
@ -3898,7 +3900,7 @@ static void ami_redraw_callback(void *p)
void ami_schedule_redraw(struct gui_window_2 *gwin, bool full_redraw)
{
int cs = 0;
if(gwin->bw->reformat_pending) cs = 20;
if(gwin->bw->reformat_pending) cs = nsoption_int(reformat_delay);
schedule(cs, ami_redraw_callback, gwin);
if(full_redraw) gwin->redraw_required = true;
}

View File

@ -80,6 +80,8 @@
int cairo_renderer; \
bool direct_render; \
bool window_simple_refresh; \
bool resize_with_contents; \
int reformat_delay; \
int redraw_tile_size_x; \
int redraw_tile_size_y; \
int monitor_aspect_x; \
@ -145,6 +147,8 @@
.cairo_renderer = 0, \
.direct_render = false, \
.window_simple_refresh = false, \
.resize_with_contents = false, \
.reformat_delay = 0, \
.redraw_tile_size_x = 0, \
.redraw_tile_size_y = 0, \
.monitor_aspect_x = 0, \
@ -209,6 +213,8 @@
{ "cairo_renderer", OPTION_INTEGER, &nsoptions.cairo_renderer}, \
{ "direct_render", OPTION_BOOL, &nsoptions.direct_render}, \
{ "window_simple_refresh", OPTION_BOOL, &nsoptions.window_simple_refresh}, \
{ "resize_with_contents", OPTION_BOOL, &nsoptions.resize_with_contents}, \
{ "reformat_delay", OPTION_INTEGER, &nsoptions.reformat_delay}, \
{ "redraw_tile_size_x", OPTION_INTEGER, &nsoptions.redraw_tile_size_x}, \
{ "redraw_tile_size_y", OPTION_INTEGER, &nsoptions.redraw_tile_size_y}, \
{ "monitor_aspect_x", OPTION_INTEGER, &nsoptions.monitor_aspect_x}, \