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. --- src/Fl_Tabs.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Fl_Tabs.cxx') diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index 4c83b6476..9b626456b 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -417,7 +417,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { o->draw_label(x1, y() + yofs, W, H - yofs, tab_align()); if (Fl::focus() == this && o->visible()) - draw_focus(box(), x1, y(), W, H); + draw_focus(bt, x1, y(), W, H, bc); fl_pop_clip(); } else { @@ -435,7 +435,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { o->draw_label(x1, y() + h() - H, W, H - yofs, tab_align()); if (Fl::focus() == this && o->visible()) - draw_focus(box(), x1, y() + h() - H, W, H); + draw_focus(bt, x1, y() + h() - H, W, H, bc); fl_pop_clip(); } -- cgit v1.2.3