[gnome-clocks] Do not show 60 seconds remaining
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Do not show 60 seconds remaining
- Date: Fri, 15 Mar 2013 17:08:53 +0000 (UTC)
commit 0e65993ebd8a3cb86101771d33355e6090a77ccf
Author: Paolo Borelli <pborelli gnome org>
Date: Fri Mar 15 16:44:31 2013 +0100
Do not show 60 seconds remaining
We should show 1 minute, instead so we need to round up before
calculating h, m, s.
https://bugzilla.gnome.org/show_bug.cgi?id=695916
src/timer.vala | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/timer.vala b/src/timer.vala
index 3f742bf..91d71d7 100644
--- a/src/timer.vala
+++ b/src/timer.vala
@@ -209,15 +209,15 @@ public class MainPanel : Gd.Stack, Clocks.Clock {
private void update_countdown (double t) {
if (time_label.get_mapped ()) {
+ // Math.ceil() because we count backwards:
+ // with 0.3 seconds we want to show 1 second remaining,
+ // with 59.2 seconds we want to show 1 minute, etc
+ t = Math.ceil (t);
int h;
int m;
int s;
double r;
Utils.time_to_hms (t, out h, out m, out s, out r);
-
- // Math.ceil() because we count backwards: with 0.3 seconds
- // we want to show 1 second remaining
- s += (int) Math.ceil (r);
update_countdown_label (h, m, s);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]