Make browser window widget remove caret on "strip focus" event.

This commit is contained in:
Michael Drake 2012-07-31 22:16:06 +01:00
parent 72cb5b6ea4
commit 9505fdcf84
1 changed files with 15 additions and 0 deletions

View File

@ -1153,6 +1153,20 @@ create_toolbar(struct gui_window *gw,
return toolbar;
}
/** Routine called when "stripped of focus" event occours for browser widget.
*
* @param widget The widget reciving "stripped of focus" event.
* @param cbi The callback parameters.
* @return The callback result.
*/
static int
fb_browser_window_strip_focus(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
fbtk_set_caret(widget, false, 0, 0, 0, NULL);
return 0;
}
static void
create_browser_widget(struct gui_window *gw, int toolbar_height, int furniture_width)
{
@ -1169,6 +1183,7 @@ create_browser_widget(struct gui_window *gw, int toolbar_height, int furniture_w
fbtk_set_handler(gw->browser, FBTK_CBT_REDRAW, fb_browser_window_redraw, gw);
fbtk_set_handler(gw->browser, FBTK_CBT_INPUT, fb_browser_window_input, gw);
fbtk_set_handler(gw->browser, FBTK_CBT_CLICK, fb_browser_window_click, gw);
fbtk_set_handler(gw->browser, FBTK_CBT_STRIP_FOCUS, fb_browser_window_strip_focus, gw);
fbtk_set_handler(gw->browser, FBTK_CBT_POINTERMOVE, fb_browser_window_move, gw);
}