Fl_Progress didn't use a contrasting label color over the progress bar,

so dark bars would make it difficult to read the label.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4160 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2005-03-21 19:52:53 +00:00
parent 7d6b887401
commit e2a04270b9
2 changed files with 14 additions and 8 deletions
+2
View File
@@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR - Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745) #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 - fl_read_image() didn't use the right red, green, and
blue masks on XFree86. blue masks on XFree86.
- Fixed Quickdraw drawing of 3 and 4 sided polygons (STR - Fixed Quickdraw drawing of 3 and 4 sided polygons (STR
+12 -8
View File
@@ -69,22 +69,26 @@ void Fl_Progress::draw()
else else
progress = 0; progress = 0;
// Draw the box... // Draw the box and label...
if (progress > 0) if (progress > 0) {
{ Fl_Color c = labelcolor();
labelcolor(fl_contrast(labelcolor(), color2()));
fl_clip(x(), y(), progress + bx, h()); fl_clip(x(), y(), progress + bx, h());
draw_box(box(), x(), y(), w(), h(), active_r() ? color2() : fl_inactive(color2())); draw_box(box(), x(), y(), w(), h(), active_r() ? color2() : fl_inactive(color2()));
draw_label(tx, y() + by, tw, h() - bh);
fl_pop_clip(); fl_pop_clip();
labelcolor(c);
fl_clip(tx + progress, y(), w() - progress, h()); fl_clip(tx + progress, y(), w() - progress, h());
draw_box(box(), x(), y(), w(), h(), active_r() ? color() : fl_inactive(color())); draw_box(box(), x(), y(), w(), h(), active_r() ? color() : fl_inactive(color()));
draw_label(tx, y() + by, tw, h() - bh);
fl_pop_clip(); fl_pop_clip();
} } else {
else
draw_box(box(), x(), y(), w(), h(), color()); draw_box(box(), x(), y(), w(), h(), color());
draw_label(tx, y() + by, tw, h() - bh);
// Finally, the label... }
draw_label(tx, y() + by, tw, h() - bh);
} }