aboutsummaryrefslogtreecommitdiff
path: root/src/pr_clock.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-09-24 22:14:38 +0200
committerThomas White <taw@bitwiz.org.uk>2014-09-24 22:14:38 +0200
commit217a194d10d404d1b78dec1b8ea89cfcc123ac29 (patch)
tree73831ff96d9ae9410d62de30e6aead667feb375b /src/pr_clock.c
parent76e314488bb87404c358e96ab48e6ae4602c05c1 (diff)
Great big warning when timer has not been started
Diffstat (limited to 'src/pr_clock.c')
-rw-r--r--src/pr_clock.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/pr_clock.c b/src/pr_clock.c
index 78cb7c4..1f8840b 100644
--- a/src/pr_clock.c
+++ b/src/pr_clock.c
@@ -1,7 +1,7 @@
/*
* pr_clock.c
*
- * Copyright © 2013 Thomas White <taw@bitwiz.org.uk>
+ * Copyright © 2013-2014 Thomas White <taw@bitwiz.org.uk>
*
* This file is part of Colloquium.
*
@@ -233,7 +233,7 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr, struct pr_clock *n)
width = gtk_widget_get_allocated_width(GTK_WIDGET(da));
height = gtk_widget_get_allocated_height(GTK_WIDGET(da));
- s = width-20;
+ s = width-20.0;
/* Overall background */
cairo_rectangle(cr, 10.0, 0.0, s, height);
@@ -262,6 +262,16 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr, struct pr_clock *n)
cairo_set_source_rgb(cr, 1.0, 0.0, 1.0);
cairo_stroke(cr);
+ if ( !n->running ) {
+ cairo_move_to(cr, 10.0, height*0.8);
+ cairo_set_font_size(cr, height*0.8);
+ cairo_select_font_face(cr, "sans-serif",
+ CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_BOLD);
+ cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
+ cairo_show_text(cr, "Timer is NOT running!");
+ }
+
return FALSE;
}
@@ -334,6 +344,8 @@ static gboolean start_sig(GtkWidget *w, gpointer data)
"Stop");
}
+ update_clock(n);
+
return FALSE;
}