summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-08-03 14:17:59 +0200
committerMatthias Melcher <github@matthiasm.com>2024-08-03 14:18:04 +0200
commit0654da9d4ad47b20a2afe7cf14c971125f60e559 (patch)
treee7fd4af8fbaf7887f0e5c05ad99d9c359fe9c2d7 /src
parent97b1df805e84797071a1b2544c68691327e6b506 (diff)
Fixes Fl_Tags close button and pulldown button color.
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Tabs.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index 5f60a1dde..c891ea2d3 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -482,7 +482,12 @@ void Fl_Tabs::draw_overflow_menu_button() {
}
draw_box(box(), X, Y, H, H, color());
Fl_Rect r(X, Y, H, H);
- Fl_Color arrow_color = active_r() ? labelcolor() : fl_inactive(labelcolor());
+ // labelcolor() is historically used to contrast selectioncolor() and is
+ // useless her, so we fall back to contrast the background color on the
+ // gray ramp.
+ Fl_Color arrow_color = fl_contrast(FL_GRAY_RAMP+0, color());
+ if (!active_r())
+ arrow_color = fl_inactive(arrow_color);
fl_draw_arrow(r, FL_ARROW_CHOICE, FL_ORIENT_NONE, arrow_color);
}
@@ -986,7 +991,10 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int flags, in
// Draw the "close" button if requested
if ( (o->when() & FL_WHEN_CLOSED) && !(flags & 1) ) {
int sz = labelsize()/2, sy = (H - sz)/2;
- fl_draw_symbol("@3+", x1 + EXTRASPACE/2, y() + yofs/2 + sy, sz, sz, o->labelcolor());
+ Fl_Color close_color = fl_contrast(FL_GRAY_RAMP+0, bc);
+ if (!active_r())
+ close_color = fl_inactive(close_color);
+ fl_draw_symbol("@3+", x1 + EXTRASPACE/2, y() + yofs/2 + sy, sz, sz, close_color);
wc = sz + EXTRAGAP;
}
@@ -1008,7 +1016,10 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int flags, in
// Draw the "close" button if requested
if ( (o->when() & FL_WHEN_CLOSED) && (x1+W < x2) ) {
int sz = labelsize()/2, sy = (H - sz)/2;
- fl_draw_symbol("@3+", x1 + EXTRASPACE/2, y() + h() - H -yofs/2 + sy, sz, sz, o->labelcolor());
+ Fl_Color close_color = fl_contrast(FL_GRAY_RAMP+0, bc);
+ if (!active_r())
+ close_color = fl_inactive(close_color);
+ fl_draw_symbol("@3+", x1 + EXTRASPACE/2, y() + h() - H -yofs/2 + sy, sz, sz, close_color);
wc = sz + EXTRAGAP;
}