Esempio n. 1
0
File: gui.c Progetto: mmuman/NetSurf
/**
 * Update the extent of the inside of a browser window to that of the
 * current content.
 *
 * It seems this method is called when content size got adjusted, so
 * that we can adjust scroll info. We also have to call it when tab
 * change occurs.
 *
 * \param gw gui_window to update the extent of
 */
static void gui_window_update_extent(struct gui_window *gw)
{

    if(browser_window_has_content(gw->browser->bw)) {
	/** @todo store content size. */
	if(window_get_active_gui_window(gw->root) == gw) {
	    int width, height;
	    GRECT area;
	    browser_window_get_extents(gw->browser->bw, false, &width, &height);
	    window_set_content_size(gw->root, width, height);
	    window_update_back_forward(gw->root);
	    window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
	    window_schedule_redraw_grect(gw->root, &area);
	}
    }
}
Esempio n. 2
0
/* It seems this method is called when content size got adjusted,
	so that we can adjust scroll info. We also have to call it when tab
	change occurs.
*/
void gui_window_update_extent(struct gui_window *gw)
{

    if( gw->browser->bw->current_content != NULL ) {
        // TODO: store content size!
        if(window_get_active_gui_window(gw->root) == gw) {
            window_set_content_size( gw->root,
                                     content_get_width(gw->browser->bw->current_content),
                                     content_get_height(gw->browser->bw->current_content)
                                   );
            window_update_back_forward(gw->root);
            GRECT area;
            window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
            window_schedule_redraw_grect(gw->root, &area);
        }
    }
}