From f4b2a3cd0c76d4e4e1514bbe604cc448f3d4e382 Mon Sep 17 00:00:00 2001
From: Benny Samir Hierl <bennysamir@posteo.de>
Date: Sat, 24 Oct 2020 20:16:05 +0200
Subject: [PATCH] VRR-Monitor: show original time and the delay in red

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
---
 VRR-Monitor/VRR-Monitor.js | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/VRR-Monitor/VRR-Monitor.js b/VRR-Monitor/VRR-Monitor.js
index 41a9e89..2dbe05f 100644
--- a/VRR-Monitor/VRR-Monitor.js
+++ b/VRR-Monitor/VRR-Monitor.js
@@ -3,9 +3,11 @@
 // icon-color: deep-green; icon-glyph: bus-alt;
 
 /**************
-Version 1.1.0
+Version 1.2.0
 
 Changelog:
+  v1.2.0:
+          - show original time and the delay in red
   v1.1.0:
           - Line filter support added
           - Setup Wizard enhanced
@@ -257,7 +259,7 @@ widget.addSpacer(10)
   
 let row = widget.addStack()
 row.layoutHorizontally()
-row.spacing = 15
+row.spacing = 10
   
 let timeColumn = row.addStack()
 timeColumn.layoutVertically();
@@ -269,12 +271,22 @@ let directionColumn = row.addStack()
 directionColumn.layoutVertically()
   
 data.forEach(function(l) {
-    
-  let timeText = timeColumn.addText(`${l.hour}:${l.minute}`)
+  let timeStack = timeColumn.addStack()
+  timeStack.layoutHorizontally()
+  timeStack.spacing = 2
+  
+  let timeText = timeStack.addText(`${l.orgHour}:${l.orgMinute}`)
   timeText.font = Font.mediumSystemFont(12)
   timeText.textColor = new Color(textColor)
   timeText.leftAlignText()
-    
+  
+  if (parseInt(l.delay) > 0) {
+    let delayText = timeStack.addText(`+${l.delay}`)
+    delayText.font = Font.mediumSystemFont(12)
+    delayText.textColor = Color.red()
+    delayText.leftAlignText()
+  }
+  
   let lineText = lineColumn.addText(l.name)
   lineText.font = Font.mediumSystemFont(12)
   lineText.textColor = new Color(textColor)