diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-03-21 19:52:53 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-03-21 19:52:53 +0000 |
| commit | e2a04270b95e29629acfa9e293b93e549b2cbd75 (patch) | |
| tree | 695b6ebef6a3f1535210aa53e88c9008e9c0fff7 /src/Fl_Progress.cxx | |
| parent | 7d6b88740165c7d96509598b59f0e2f0de9fc04c (diff) | |
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
Diffstat (limited to 'src/Fl_Progress.cxx')
| -rw-r--r-- | src/Fl_Progress.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
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); + } } |
