[longomatch/gameunits] Show timing info properly in the game units widget
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch/gameunits] Show timing info properly in the game units widget
- Date: Mon, 5 Dec 2011 21:07:24 +0000 (UTC)
commit f375b90fb1af3aecbc013d4e00f680a2322d9ec3
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Wed Nov 30 22:40:30 2011 +0100
Show timing info properly in the game units widget
LongoMatch.GUI/Gui/Component/GameUnitWidget.cs | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/GameUnitWidget.cs b/LongoMatch.GUI/Gui/Component/GameUnitWidget.cs
index 3f1fab0..1ba2086 100644
--- a/LongoMatch.GUI/Gui/Component/GameUnitWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/GameUnitWidget.cs
@@ -56,9 +56,13 @@ namespace LongoMatch.Gui.Component
public Time CurrentTime {
set {
current = value;
- if (start != null)
+ if (start != null) {
+ Time ellapsed = value-start;
+ stopButton.Visible = ellapsed.MSeconds > 0;
label.Text = Catalog.GetString("Time" + ": " + (value-start).ToSecondsString());
- else label.Text = "";
+ } else {
+ label.Text = "";
+ }
}
}
@@ -110,8 +114,10 @@ namespace LongoMatch.Gui.Component
start = current;
eType = GameUnitEventType.Start;
}
- else if (sender == stopButton)
+ else if (sender == stopButton) {
eType = GameUnitEventType.Stop;
+ start = null;
+ }
else
eType = GameUnitEventType.Cancel;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]