Correctly calculate maximised frame heights (fix 1644216)

svn path=/trunk/netsurf/; revision=3193
This commit is contained in:
Richard Wilson 2007-03-03 20:49:49 +00:00
parent 5e783e1266
commit b5a14773ff
3 changed files with 20 additions and 3 deletions

View File

@ -58,6 +58,17 @@ int ro_get_vscroll_width(wimp_w w) {
return furniture_sizes.border_widths.x1;
}
/**
* Gets the title bar height
*
* \param w the window to read (or NULL to read a cached value)
*/
int ro_get_title_height(wimp_w w) {
ro_gui_wimp_cache_furniture_sizes(w);
return furniture_sizes.border_widths.y1;
}
/**
* Caches window furniture information
*

View File

@ -25,6 +25,7 @@
int ro_get_hscroll_height(wimp_w w);
int ro_get_vscroll_width(wimp_w w);
int ro_get_title_height(wimp_w w);
bool ro_gui_wimp_read_eig_factors(os_mode mode, int *xeig, int *yeig);
void ro_convert_os_units_to_pixels(os_coord *os_units, os_mode mode);
void ro_convert_pixels_to_os_units(os_coord *pixels, os_mode mode);

View File

@ -1690,6 +1690,7 @@ void ro_gui_window_update_theme(void) {
void gui_window_set_extent(struct gui_window *g, int width, int height)
{
int screen_width;
int toolbar_height = 0;
struct content *content;
wimp_window_state state;
@ -1719,9 +1720,13 @@ void gui_window_set_extent(struct gui_window *g, int width, int height)
/* the top-level framed window is a total pain. to get it to maximise to the
* top of the screen we need to fake it having a suitably large extent */
if (g->bw->children && (g->bw->browser_window_type == BROWSER_WINDOW_NORMAL))
height = 16384;
if (g->bw->children && (g->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) {
ro_gui_screen_size(&screen_width, &height);
if (g->toolbar)
height -= ro_gui_theme_toolbar_full_height(g->toolbar);
height -= ro_get_hscroll_height(g->window);
height -= ro_get_title_height(g->window);
}
if (content) {
width = max(width, content->width * 2 * g->option.scale);
height = max(height, content->height * 2 * g->option.scale);