Commit 090485d7 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

Merge pull request #14 from locusf/statusbar

Statusbar
parents 2a9f8c59 5d7fb36e
...@@ -153,12 +153,6 @@ Item { ...@@ -153,12 +153,6 @@ Item {
width: 100 width: 100
height: width height: width
asynchronous: true asynchronous: true
onStatusChanged: {
if (status === Image.Error) {
console.log("Error loading an app icon, falling back to default.");
iconImage.source = ":/images/icons/apps.png";
}
}
Spinner { Spinner {
id: spinner id: spinner
......
...@@ -3,22 +3,8 @@ import QtQuick 2.0 ...@@ -3,22 +3,8 @@ import QtQuick 2.0
Image { Image {
id: lockScreen id: lockScreen
source: "images/graphics-wallpaper-home.jpg" source: "images/graphics-wallpaper-home.jpg"
/**
* openingState should be a value between 0 and 1, where 0 means
* the lockscreen is "down" (obscures the view) and 1 means the
* lockscreen is "up" (not visible).
**/
visible: LipstickSettings.lockscreenVisible visible: LipstickSettings.lockscreenVisible
function snapPosition() {
}
Connections {
target: LipstickSettings
onLockscreenVisibleChanged: snapPosition()
}
LockscreenClock { LockscreenClock {
anchors { anchors {
top: parent.top top: parent.top
......
...@@ -36,7 +36,6 @@ import QtQuick.Controls.Styles.Nemo 1.0 ...@@ -36,7 +36,6 @@ import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import org.nemomobile.time 1.0 import org.nemomobile.time 1.0
import org.nemomobile.configuration 1.0 import org.nemomobile.configuration 1.0
import org.freedesktop.contextkit 1.0
import "scripts/desktop.js" as Desktop import "scripts/desktop.js" as Desktop
Page { Page {
...@@ -64,61 +63,19 @@ Page { ...@@ -64,61 +63,19 @@ Page {
} else { Qt.quit(); } } else { Qt.quit(); }
} }
} }
Connections {
target: batterystatus
onValueChanged: {
if(batterystatus.value > 85) {
batteryimg.source = "images/battery6.png"
} else if (batterystatus.value <= 5) {
batteryimg.source = "images/battery0.png"
} else if (batterystatus.value <= 10) {
batteryimg.source = "images/battery1.png"
} else if (batterystatus.value <= 25) {
batteryimg.source = "images/battery2.png"
} else if (batterystatus.value <= 40) {
batteryimg.source = "images/battery3.png"
} else if (batterystatus.value <= 65) {
batteryimg.source = "images/battery4.png"
} else if (batterystatus.value <= 80) {
batteryimg.source = "images/battery5.png"
}
batterylbl.text = batterystatus.value + "%"
}
}
ContextProperty { Statusbar {
id: batterystatus id: statusbar
key: "Battery.ChargePercentage"
value: "100"
} }
Rectangle {
id: toolbar
color: "black"
height: 40
width: parent.width
border.color: "white"
border.width: 1
z: 201
anchors.bottom: parent.bottom
Image {
id: batteryimg
width: 32
height: 32
}
Label {
anchors.left: batteryimg.right
id: batterylbl
color: "white"
font.pointSize: 8
}
}
Component.onCompleted: { Component.onCompleted: {
Desktop.instance = desktop Desktop.instance = desktop
} }
function lockscreenVisible() { function lockscreenVisible() {
return LipstickSettings.lockscreenVisible === true return LipstickSettings.lockscreenVisible === true
} }
function setLockScreen(enabled) { function setLockScreen(enabled) {
if (enabled) { if (enabled) {
LipstickSettings.lockScreen(true) LipstickSettings.lockScreen(true)
...@@ -154,6 +111,12 @@ Page { ...@@ -154,6 +111,12 @@ Page {
// Initial view should be the AppLauncher // Initial view should be the AppLauncher
currentIndex: 0 currentIndex: 0
} }
Image {
id:wallpaper
source: "images/wallpaper-portrait-bubbles.png"
anchors.fill: parent
z: -100
}
Lockscreen { Lockscreen {
id: lockScreen id: lockScreen
...@@ -161,4 +124,5 @@ Page { ...@@ -161,4 +124,5 @@ Page {
height: parent.height height: parent.height
z: 200 z: 200
} }
} }
/****************************************************************************************
**
** Copyright (C) 2014 Aleksi Suomalainen <suomalainen.aleksi@gmail.com>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the author nor the
** names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
****************************************************************************************/
import QtQuick 2.1
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import org.freedesktop.contextkit 1.0
Item {
id: root
z: 201
height: 48
width: parent.width
anchors.bottom: parent.bottom
Rectangle {
id: statusbar
color: "black"
anchors.fill: parent
opacity: 0.5
z: 200
}
Connections {
target: batteryChargePercentage
onValueChanged: {
if(batteryChargePercentage.value > 85) {
batteryimg.source = "images/battery6.png"
} else if (batteryChargePercentage.value <= 5) {
batteryimg.source = "images/battery0.png"
} else if (batteryChargePercentage.value <= 10) {
batteryimg.source = "images/battery1.png"
} else if (batteryChargePercentage.value <= 25) {
batteryimg.source = "images/battery2.png"
} else if (batteryChargePercentage.value <= 40) {
batteryimg.source = "images/battery3.png"
} else if (batteryChargePercentage.value <= 65) {
batteryimg.source = "images/battery4.png"
} else if (batteryChargePercentage.value <= 80) {
batteryimg.source = "images/battery5.png"
}
}
}
Connections {
target: cellularSignalBars
onValueChanged: {
cellularbars.text = cellularSignalBars.value
}
}
ContextProperty {
id: batteryChargePercentage
key: "Battery.ChargePercentage"
value: "100"
}
ContextProperty {
id: cellularSignalBars
key: "Cellular.SignalBars"
}
ContextProperty {
id: cellularRegistrationStatus
key: "Cellular.RegistrationStatus"
}
Rectangle {
id: cellular
anchors.left: parent.left
color: "transparent"
height: 48
width: 48
anchors.margins: 8
Label {
id: cellularbars
width: 32
height: 32
font.pointSize: 8
}
}
Rectangle {
id: wifi
anchors.left: cellular.right
color: "transparent"
height: 48
width: 48
anchors.margins: 8
}
Rectangle {
id: bluetooth
anchors.left: wifi.right
color: "transparent"
height: 48
width: 48
anchors.margins: 8
Image {
source: bluetoothConnected.value !== undefined && bluetoothConnected.value ? "image://theme/icon-status-bluetooth-connected" : "image://theme/icon-status-bluetooth"
ContextProperty {
id: bluetoothEnabled
key: "Bluetooth.Enabled"
}
ContextProperty {
id: bluetoothConnected
key: "Bluetooth.Connected"
}
}
}
Rectangle {
id: nfc
anchors.left: bluetooth.right
color: "transparent"
height: 48
width: 48
anchors.margins: 8
Image {
source: "image://theme/icon-nfc-enabled"
}
}
Rectangle {
id: gps
anchors.left: nfc.right
color: "transparent"
height: 48
width: 48
anchors.margins: 8
Image {
source: "image://theme/icon-gps-enabled"
}
}
Rectangle {
id: playlist
anchors.left: gps.right
color: "transparent"
height: 48
width: 48
anchors.margins: 8
Image {
source: "image://theme/icon-playlist-playpause"
}
}
Rectangle {
id: clock
anchors.left: playlist.right
color: "transparent"
height: 48
width: 48
anchors.margins: 8
Label {
id: hours
width: 16
height: 16
font.pointSize: 6
text: Qt.formatDateTime(wallClock.time, "hh")
}
Label {
id: minutes
anchors.top: hours.bottom
anchors.topMargin: 4
width: 16
height: 16
font.pointSize: 6
text: Qt.formatDateTime(wallClock.time, "mm")
}
}
Rectangle {
anchors.right: parent.right
height: 48
width: 48
color: "transparent"
anchors.margins: 8
Image {
id: batteryimg
width: 32
height: 32
}
}
}
...@@ -82,10 +82,9 @@ Compositor { ...@@ -82,10 +82,9 @@ Compositor {
} }
} }
Rectangle { Item {
id: layersParent id: layersParent
anchors.fill: parent anchors.fill: parent
color: "black"
Item { Item {
id: homeLayer id: homeLayer
......
...@@ -36,5 +36,7 @@ ...@@ -36,5 +36,7 @@
<file>qml/images/notification-circle.png</file> <file>qml/images/notification-circle.png</file>
<file>qml/scripts/desktop.js</file> <file>qml/scripts/desktop.js</file>
<file>qml/FeedsPage.qml</file> <file>qml/FeedsPage.qml</file>
<file>qml/Statusbar.qml</file>
<file>qml/images/wallpaper-portrait-bubbles.png</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -43,6 +43,7 @@ OTHER_FILES += qml/*.qml \ ...@@ -43,6 +43,7 @@ OTHER_FILES += qml/*.qml \
qml/compositor/ScreenGestureArea.qml \ qml/compositor/ScreenGestureArea.qml \
qml/NotificationPreview.qml \ qml/NotificationPreview.qml \
qml/scripts/desktop.js \ qml/scripts/desktop.js \
qml/FeedsPage.qml qml/FeedsPage.qml \
qml/Statusbar.qml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment