summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--src/Fl_Choice.cxx9
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index f2ed873f6..58f71ff15 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.3.0
+ - Fixed Fl_Choice contrast with light-on-dark settings (STR #2219)
- Fixed X server "lock", if a modal dialog window is opened
while a menu is active (STR #1986)
- Updated mirror sites in documentation (STR #2220)
diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx
index e17e59df4..9fd90c8f9 100644
--- a/src/Fl_Choice.cxx
+++ b/src/Fl_Choice.cxx
@@ -67,7 +67,11 @@ void Fl_Choice::draw() {
fl_yxline(x1 - 6, y1 - 8, y1 + 8);
}
} else {
- draw_box(FL_DOWN_BOX, FL_BACKGROUND2_COLOR);
+ if (fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) == textcolor()) {
+ draw_box(FL_DOWN_BOX, FL_BACKGROUND2_COLOR);
+ } else {
+ draw_box(FL_DOWN_BOX, fl_lighter(color()));
+ }
draw_box(FL_UP_BOX,X,Y,W,H,color());
fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor()));
@@ -171,7 +175,8 @@ int Fl_Choice::handle(int e) {
case FL_PUSH:
if (Fl::visible_focus()) Fl::focus(this);
J1:
- if (Fl::scheme()) {
+ if (Fl::scheme()
+ || fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) != textcolor()) {
v = menu()->pulldown(x(), y(), w(), h(), mvalue(), this);
} else {
// In order to preserve the old look-n-feel of "white" menus,