[longomatch] Show timing info properly in the game units widget



commit 08ed38a198344c89d3c2736f4cc55bc3570fecd6
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]