make statusbar work

svn path=/trunk/netsurf/; revision=6465
This commit is contained in:
Vincent Sanders 2009-02-13 01:43:32 +00:00
parent f32c4ff799
commit 7ff747e1e6
3 changed files with 28 additions and 2 deletions

View File

@ -303,7 +303,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
g->x = 0;
g->y = 30;
g->width = framebuffer->width;
g->height = framebuffer->height - 60;
g->height = framebuffer->height - 50;
g->bw = bw;
if (window_list == NULL) {
@ -457,7 +457,7 @@ void gui_window_update_extent(struct gui_window *g)
void gui_window_set_status(struct gui_window *g, const char *text)
{
LOG(("g %p, text %s", g, text));
fb_rootwindow_status(framebuffer, text);
}
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)

View File

@ -454,6 +454,30 @@ fb_widget_rightarrow_click(struct gui_window *g, browser_mouse_state st, int x,
}
void fb_rootwindow_status(framebuffer_t *fb, const char* text)
{
bbox_t saved_plot_ctx;
/* enlarge the clipping rectangle to the whole screen for plotting the
* root window
*/
saved_plot_ctx = fb_plot_ctx;
fb_plot_ctx.x0 = 0;
fb_plot_ctx.y0 = fb->height - 20;
fb_plot_ctx.x1 = fb->width;
fb_plot_ctx.y1 = fb->height;
/* do our drawing etc. */
plot.fill(0, fb_plot_ctx.y0, fb_plot_ctx.x1, fb_plot_ctx.y1, 0xFFFFFFFF);
plot.text(fb_plot_ctx.x0, fb_plot_ctx.y0 + 15, NULL, text, strlen(text), 0xffffffff, 0xFF000000);
fb_os_redraw(&fb_plot_ctx);
/* restore clipping rectangle */
fb_plot_ctx = saved_plot_ctx;
}
void fb_rootwindow_create(framebuffer_t *fb)
{
bbox_t saved_plot_ctx;

View File

@ -22,3 +22,5 @@ void fb_rootwindow_click(struct gui_window *g, browser_mouse_state st , int x, i
void fb_rootwindow_create(framebuffer_t *fb);
struct fb_widget *fb_add_window_widget(struct gui_window *g, fb_widget_mouseclick_t click_rtn);
void fb_rootwindow_status(framebuffer_t *fb, const char* text);