diff --git a/CHANGES b/CHANGES index a52bbd2f6..78d1ea233 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.7 - Documentation fixes (STR #648, STR #692, STR #730, STR #744, STR #745) + - Fl_Progress now contrasts the label color with the bar + color, so labels will be readable at all times. - fl_read_image() didn't use the right red, green, and blue masks on XFree86. - Fixed Quickdraw drawing of 3 and 4 sided polygons (STR diff --git a/src/Fl_Progress.cxx b/src/Fl_Progress.cxx index e2974507b..3b0acb4e4 100644 --- a/src/Fl_Progress.cxx +++ b/src/Fl_Progress.cxx @@ -69,22 +69,26 @@ void Fl_Progress::draw() else progress = 0; - // Draw the box... - if (progress > 0) - { + // Draw the box and label... + if (progress > 0) { + Fl_Color c = labelcolor(); + labelcolor(fl_contrast(labelcolor(), color2())); + fl_clip(x(), y(), progress + bx, h()); draw_box(box(), x(), y(), w(), h(), active_r() ? color2() : fl_inactive(color2())); + draw_label(tx, y() + by, tw, h() - bh); fl_pop_clip(); + labelcolor(c); + fl_clip(tx + progress, y(), w() - progress, h()); draw_box(box(), x(), y(), w(), h(), active_r() ? color() : fl_inactive(color())); + draw_label(tx, y() + by, tw, h() - bh); fl_pop_clip(); - } - else + } else { draw_box(box(), x(), y(), w(), h(), color()); - - // Finally, the label... - draw_label(tx, y() + by, tw, h() - bh); + draw_label(tx, y() + by, tw, h() - bh); + } }