[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/base/plasma/kde-artwork-active/lockscreen
From:       Marco Martin <notmart () gmail ! com>
Date:       2011-11-23 16:09:09
Message-ID: 20111123160909.43678AC88C () svn ! kde ! org
[Download RAW message or body]

SVN commit 1265604 by mart:

restore wallpaper and clock


 M  +58 -2     lockscreen-active.qml  


--- trunk/playground/base/plasma/kde-artwork-active/lockscreen/lockscreen-active.qml #1265603:1265604
@@ -22,14 +22,18 @@
 import org.kde.qtextracomponents 0.1
 
 
-Rectangle {
+Item {
     id: lockScreen
     width: 800
     height: 600
-    color: Qt.rgba(0, 0, 0, 0.8)
 
     signal unlockRequested()
 
+    Image {
+        source: "wallpaper.png"
+        anchors.centerIn: parent
+    }
+
     MouseArea {
         anchors.fill: parent
         onPressed: mouse.accepted = true
@@ -53,6 +57,36 @@
         height: 120
     }
 
+    PlasmaCore.DataSource {
+        id: timeSource
+        engine: "time"
+        connectedSources: ["Local"]
+        interval: 30000
+    }
+
+    //FIXME: use dataengines (needs bindings from libplasma)
+    // also, format with klocale
+    Timer {
+        id: clockTimer
+        repeat: true
+        running: true
+        interval: 30000
+        triggeredOnStart: true
+        property string time
+        onTriggered: {
+            var currentTime = new Date();
+            var currentHours = currentTime.getHours()
+            if (currentHours < 10) {
+                currentHours = "0" + currentHours
+            }
+            var currentMinutes = currentTime.getMinutes()
+            if (currentMinutes < 10) {
+                currentMinutes = "0" + currentMinutes
+            }
+            time = currentHours+":"+currentMinutes
+        }
+    }
+
     Item {
         id: unlockArea
         anchors {
@@ -62,6 +96,28 @@
             right: parent.right
         }
 
+        Text {
+            text: clockTimer.time
+            font.pixelSize: 75
+            font.family: theme.font.family
+            font.bold: theme.font.bold
+            color: Qt.rgba(0, 0, 0, 0)
+            style: Text.Sunken
+            styleColor: Qt.rgba(0, 0, 0, 0.5)
+            anchors.horizontalCenter: parent.horizontalCenter
+            y: 100
+        }
+        Text {
+            text: clockTimer.time
+            font.pixelSize: 75
+            font.family: theme.font.family
+            font.bold: theme.font.bold
+            color: Qt.rgba(0, 0, 0, 0.05)
+            style: Text.Raised
+            styleColor: Qt.rgba(1, 1, 1, 0.8)
+            anchors.horizontalCenter: parent.horizontalCenter
+            y: 100
+        }
 
         Text {
             id: unlockText
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic