summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2009-09-16 07:06:41 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2009-09-16 07:06:41 +0000
commitd631c334a2418df38f9f8520f7a2ad3f952f1f1b (patch)
treec3d3f240a3492c0731f72c5c08fde3c2ae41c1a9 /src
parent3cf86721739328f1a18a318dfcb583497b91728c (diff)
Fixed Fl_Choice contrast with light-on-dark settings (STR #2219).
Patch provided by Aaron M. Ucko, thanks. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6873 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Choice.cxx9
1 files changed, 7 insertions, 2 deletions
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,