Hi,
Some time ago I proposed to add a clock to the actdead charging UI in TJC 
since it would allow a quite frequent use case for me: shutdown the phone 
during the night but still be able to read the current time if in charging 
mode.
Here is the original entry: https://together.jolla.com/question/110738/
request-clock-on-charging-screen/

Recently I received my Jolla C and found out the shipped Sailfish OS version 
allows access to the code of actdead charging. So here is a patch allowing 
this functionality. I also shared it on TJC.

Best regards.
-- 


Unai IRIGOYEN
--- main.backup	2016-07-26 22:18:35.100901902 +0200
+++ main.qml	2016-07-26 22:18:35.131901980 +0200
@@ -1,6 +1,8 @@
 import QtQuick 2.0
 import Sailfish.Silica 1.0
 import org.freedesktop.contextkit 1.0
+import org.nemomobile.time 1.0
+import org.nemomobile.configuration 1.0
 
 ApplicationWindow {
     cover: undefined
@@ -14,6 +16,27 @@
         anchors.fill: parent
         opacity: !actdeadApplication.splashScreenVisible ? 1.0 : 0.0
         Behavior on opacity { NumberAnimation { duration: 1000 } }
+        Text {
+            id: clock
+            anchors.bottom: parent.bottom
+            anchors.horizontalCenter: parent.horizontalCenter
+            text: if (timeFormatConfig.value === "24") {
+                return Format.formatDate(wallClock.time, Format.TimeValueTwentyFourHours);
+            } else {
+                var format = qsTrId("lipstick-jolla-home-12h_time_pattern_without_ap");
+                return wallClock.time.toLocaleTimeString(Qt.locale(), format);
+            }
+            color: Theme.primaryColor
+            font { pixelSize: Theme.fontSizeHuge*2.25; family: Theme.fontFamilyHeading }
+            WallClock {
+                id: wallClock
+                updateFrequency: WallClock.Minute
+            }
+            ConfigurationValue {
+                id: timeFormatConfig
+                key: "/sailfish/i18n/lc_timeformat24h"
+            }
+        }
         Image {
             id: background
             anchors.centerIn: parent
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to