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.1@6872 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2009-09-16 07:04:37 +00:00
parent d3557c8e60
commit 5242b4e5cd
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.10
- Fixed Fl_Choice contrast with light-on-dark settings (STR #2219)
- Added Xft2 font lookup table (STR #2215)
- Fixed X server "lock", if a modal dialog window is opened
while a menu is active (STR #1986)

View File

@ -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()));
@ -149,7 +153,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,