{"action":"created","issue":{"url":"https://api.github.com/repos/xylosper/bomi/issues/292","labels_url":"https://api.github.com/repos/xylosper/bomi/issues/292/labels{/name}","comments_url":"https://api.github.com/repos/xylosper/bomi/issues/292/comments","events_url":"https://api.github.com/repos/xylosper/bomi/issues/292/events","html_url":"https://github.com/xylosper/bomi/issues/292","id":66670798,"number":292,"title":"Show remaining time in all skins with TimeDuration","user":{"login":"zoli","id":3286303,"avatar_url":"https://avatars.githubusercontent.com/u/3286303?v=3","gravatar_id":"","url":"https://api.github.com/users/zoli","html_url":"https://github.com/zoli","followers_url":"https://api.github.com/users/zoli/followers","following_url":"https://api.github.com/users/zoli/following{/other_user}","gists_url":"https://api.github.com/users/zoli/gists{/gist_id}","starred_url":"https://api.github.com/users/zoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoli/subscriptions","organizations_url":"https://api.github.com/users/zoli/orgs","repos_url":"https://api.github.com/users/zoli/repos","events_url":"https://api.github.com/users/zoli/events{/privacy}","received_events_url":"https://api.github.com/users/zoli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-06T18:20:51Z","updated_at":"2015-04-07T08:47:00Z","closed_at":null,"body":"Toggle showing remaining time and elapsed time on click on `TimeText`.\r\nSome of the skins already have this feature but i think it would be nice to have this feature for all skins with  `TimeDuration`. \r\nThis is a simple patch I'm using currently I can create pr if you agree with this feature.\r\n\r\n```\r\ndiff --git a/src/bomi/imports/bomi/TimeDuration.qml b/src/bomi/imports/bomi/TimeDuration.qml\r\nindex f817d63..b4d5a6b 100644\r\n--- a/src/bomi/imports/bomi/TimeDuration.qml\r\n+++ b/src/bomi/imports/bomi/TimeDuration.qml\r\n@@ -23,8 +23,14 @@ Item {\r\n             verticalCenter: slash.verticalCenter\r\n         }\r\n         time: d.engine.time\r\n+        end: d.engine.end\r\n         textStyle: item.textStyle\r\n         msec: item.msec\r\n+\r\n+        MouseArea {\r\n+            anchors.fill: parent\r\n+            onClicked: timeText.remaining = !timeText.remaining\r\n+        }\r\n     }\r\n     B.Text {\r\n         id: slash;\r\ndiff --git a/src/bomi/imports/bomi/TimeText.qml b/src/bomi/imports/bomi/TimeText.qml\r\nindex 7d01b31..a5145f0 100644\r\n--- a/src/bomi/imports/bomi/TimeText.qml\r\n+++ b/src/bomi/imports/bomi/TimeText.qml\r\n@@ -4,9 +4,22 @@ import bomi 1.0 as B\r\n B.Text {\r\n     id: item\r\n     property int time: 0\r\n+    property int end: 0\r\n     property bool msec: false\r\n+    property bool remaining: false\r\n+\r\n+    QtObject {\r\n+       id: s; property int time: (item.time/1000) | 0\r\n+       property int end: (item.end/1000) | 0\r\n+    }\r\n+\r\n+    function calcTime() {\r\n+        var tm = msec ? time : s.time * 1000,\r\n+            en = msec ? end : s.end * 1000;\r\n+\r\n+        return remaining ? en - tm : tm;\r\n         time: d.engine.time\r\n+        end: d.engine.end\r\n         textStyle: item.textStyle\r\n         msec: item.msec\r\n+\r\n+        MouseArea {\r\n+            anchors.fill: parent\r\n+            onClicked: timeText.remaining = !timeText.remaining\r\n+        }\r\n     }\r\n     B.Text {\r\n         id: slash;\r\ndiff --git a/src/bomi/imports/bomi/TimeText.qml b/src/bomi/imports/bomi/TimeText.qml\r\nindex 7d01b31..a5145f0 100644\r\n--- a/src/bomi/imports/bomi/TimeText.qml\r\n+++ b/src/bomi/imports/bomi/TimeText.qml\r\n@@ -4,9 +4,22 @@ import bomi 1.0 as B\r\n B.Text {\r\n     id: item\r\n     property int time: 0\r\n+    property int end: 0\r\n     property bool msec: false\r\n+    property bool remaining: false\r\n+\r\n+    QtObject {\r\n+       id: s; property int time: (item.time/1000) | 0\r\n+       property int end: (item.end/1000) | 0\r\n+    }\r\n+\r\n+    function calcTime() {\r\n+        var tm = msec ? time : s.time * 1000,\r\n+            en = msec ? end : s.end * 1000;\r\n+\r\n+        return remaining ? en - tm : tm;\r\n+    }\r\n \r\n-    QtObject { id: s; property int time: (item.time/1000) | 0 }\r\n     width: contentWidth; height: parent.height;\r\n-    content: B.Format.time(msec ? time : s.time * 1000, msec)\r\n+    content: B.Format.time(calcTime(), msec)\r\n }\r\n```"},"comment":{"url":"https://api.github.com/repos/xylosper/bomi/issues/comments/90467684","html_url":"https://github.com/xylosper/bomi/issues/292#issuecomment-90467684","issue_url":"https://api.github.com/repos/xylosper/bomi/issues/292","id":90467684,"user":{"login":"xylosper","id":4363181,"avatar_url":"https://avatars.githubusercontent.com/u/4363181?v=3","gravatar_id":"","url":"https://api.github.com/users/xylosper","html_url":"https://github.com/xylosper","followers_url":"https://api.github.com/users/xylosper/followers","following_url":"https://api.github.com/users/xylosper/following{/other_user}","gists_url":"https://api.github.com/users/xylosper/gists{/gist_id}","starred_url":"https://api.github.com/users/xylosper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xylosper/subscriptions","organizations_url":"https://api.github.com/users/xylosper/orgs","repos_url":"https://api.github.com/users/xylosper/repos","events_url":"https://api.github.com/users/xylosper/events{/privacy}","received_events_url":"https://api.github.com/users/xylosper/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T08:47:00Z","updated_at":"2015-04-07T08:47:00Z","body":"1. click duration to change duration text\r\n2. click current time to change duration text\r\n\r\nDon't you think 1. makes much more sense than 2.?"}}