From ab58971bcf9cedee6ecd131ca032087ff7d1623c Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Fri, 14 Jan 2022 17:17:09 +0100 Subject: Improve focus box drawing and documentation Add new method Fl_Widget::draw_focus(Fl_Boxtype t, int x, int y, int w, int h, Fl_Color bg) ... with background color for correct contrast testing (in Fl_Tabs) Draw the focus box of the "tabs" of Fl_Tabs widgets with the correct boxtype and background color. Make 'unsigned int visible_focus()' const so it can be used in 'const' methods. Do not draw the focus box if the per-widget focus box option is off. --- FL/fl_draw.H | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'FL/fl_draw.H') diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 8db59b43b..66125d351 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -299,7 +299,12 @@ inline void fl_rect(Fl_Rect r) { fl_rect(r.x(), r.y(), r.w(), r.h()); } -/** Draw a dotted rectangle, used to indicate keyboard focus on a widget. */ +/** Draw a dotted rectangle, used to indicate keyboard focus on a widget. + + This method draws the rectangle in the current color and independent of + the Fl::visible_focus() option. You may need to set the current color + with fl_color() before you call this. +*/ inline void fl_focus_rect(int x, int y, int w, int h) { fl_graphics_driver->focus_rect(x, y, w, h); } -- cgit v1.2.3