summaryrefslogtreecommitdiff
path: root/src/Fl_Clock.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2017-05-15 15:30:52 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2017-05-15 15:30:52 +0000
commita1d39365542272f6036461fee391e86c0c3be59c (patch)
treef67599cf56e8bf92661452ff6a12524c461dbda1 /src/Fl_Clock.cxx
parent034148b289ded6e5b4c8231d089c8c82ee39cea9 (diff)
Allow to disable shadows in Fl_Clock and derived widgets.
As discussed on 2017-05-15 in fltk.general, thread "Fl_clock". git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12237 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Clock.cxx')
-rw-r--r--src/Fl_Clock.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Fl_Clock.cxx b/src/Fl_Clock.cxx
index df241e8aa..4f8d4ee80 100644
--- a/src/Fl_Clock.cxx
+++ b/src/Fl_Clock.cxx
@@ -74,7 +74,6 @@ static void rect(double x, double y, double w, double h) {
*/
void Fl_Clock_Output::draw(int X, int Y, int W, int H) {
Fl_Color box_color = type()==FL_ROUND_CLOCK ? FL_GRAY : color();
- Fl_Color shadow_color = fl_color_average(box_color, FL_BLACK, 0.5);
draw_box(box(), X, Y, W, H, box_color);
fl_push_matrix();
fl_translate(X+W/2.0-.5, Y+H/2.0-.5);
@@ -85,11 +84,16 @@ void Fl_Clock_Output::draw(int X, int Y, int W, int H) {
fl_color(active_r() ? FL_FOREGROUND_COLOR : fl_inactive(FL_FOREGROUND_COLOR));
fl_begin_loop(); fl_circle(0,0,14); fl_end_loop();
}
+
// draw the shadows:
- fl_push_matrix();
- fl_translate(0.60, 0.60);
- drawhands(shadow_color, shadow_color);
- fl_pop_matrix();
+ if (shadow_) {
+ Fl_Color shadow_color = fl_color_average(box_color, FL_BLACK, 0.5);
+ fl_push_matrix();
+ fl_translate(0.60, 0.60);
+ drawhands(shadow_color, shadow_color);
+ fl_pop_matrix();
+ }
+
// draw the tick marks:
fl_push_matrix();
fl_color(active_r() ? FL_FOREGROUND_COLOR : fl_inactive(FL_FOREGROUND_COLOR));
@@ -100,6 +104,7 @@ void Fl_Clock_Output::draw(int X, int Y, int W, int H) {
fl_rotate(-30);
}
fl_pop_matrix();
+
// draw the hands:
drawhands(selection_color(), FL_FOREGROUND_COLOR); // color was 54
fl_pop_matrix();
@@ -160,6 +165,7 @@ Fl_Clock_Output::Fl_Clock_Output(int X, int Y, int W, int H, const char *L)
minute_ = 0;
second_ = 0;
value_ = 0;
+ shadow_ = 1;
}
////////////////////////////////////////////////////////////////