Commit bfbd154c authored by eekkelund's avatar eekkelund

[StatusBar] Statusbar functions like in spec. Sliding, animation and settings...

[StatusBar] Statusbar functions like in spec. Sliding, animation and settings icon added. Fix battery icon in statusbar
parent d86b263d
...@@ -33,7 +33,7 @@ import "notifications" ...@@ -33,7 +33,7 @@ import "notifications"
Flickable { Flickable {
id: mainFlickable id: mainFlickable
clip: true
contentHeight: rootitem.height contentHeight: rootitem.height
contentWidth: parent.width contentWidth: parent.width
Item { Item {
......
...@@ -183,7 +183,6 @@ Item { ...@@ -183,7 +183,6 @@ Item {
found = existingTitleObject.hasOwnProperty(iconTitle) found = existingTitleObject.hasOwnProperty(iconTitle)
if (!found) { if (!found) {
// for simplicity, just adding to end instead of corresponding position in original list // for simplicity, just adding to end instead of corresponding position in original list
console.log(iconTitle)
listModel.append({'title':iconTitle, 'iconSource':iconId, 'id':id, 'category':category}) listModel.append({'title':iconTitle, 'iconSource':iconId, 'id':id, 'category':category})
} }
} }
......
...@@ -45,6 +45,7 @@ Item { ...@@ -45,6 +45,7 @@ Item {
height: Theme.itemHeightLarge height: Theme.itemHeightLarge
width: parent.width width: parent.width
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
enabled: !lockscreenVisible()
Rectangle { Rectangle {
id: statusbar id: statusbar
...@@ -53,10 +54,37 @@ Item { ...@@ -53,10 +54,37 @@ Item {
opacity: 0.5 opacity: 0.5
z: 200 z: 200
} }
//Just to capture clicks that don't hit statusbaritem
MouseArea { MouseArea {
anchors.fill: parent property int oldX
property int oldY
anchors.fill: row
z: row.z + 10
enabled: !lockscreenVisible()
onClicked: {
if(oldX != mouseX && oldY !== mouseY && row.childAt(mouseX, mouseY) && row.currentChild !== row.childAt(mouseX, mouseY)) {
row.currentChild = row.childAt(mouseX, mouseY)
row.currentChild.clicked()
}else {
row.currentChild = null
}
}
onPositionChanged: {
oldX = mouseX
oldY = mouseY
if(pressed && row.childAt(mouseX, mouseY)) {
if(row.currentChild !== row.childAt(mouseX, mouseY)) {
row.currentChild = row.childAt(mouseX, mouseY)
if(panel_loader.visible) panel_loader.visible = false
row.currentChild.clicked()
}
} else {
row.currentChild = null
}
}
} }
Connections { Connections {
target: lipstickSettings; target: lipstickSettings;
onLockscreenVisibleChanged: { onLockscreenVisibleChanged: {
...@@ -135,14 +163,39 @@ Item { ...@@ -135,14 +163,39 @@ Item {
Loader { Loader {
id: panel_loader id: panel_loader
anchors.bottom: root.top anchors.bottom: root.top
height: 240 height: 0
width: parent.width width: parent.width
visible: false visible: false
onVisibleChanged: {
if(visible) riseUp.start()
else closeDown.start()
}
NumberAnimation {
id:riseUp
target: panel_loader
property: "height"
duration: 200
from:0
to:Theme.itemWidthMedium
easing.type: Easing.InOutQuad
}
NumberAnimation {
id:closeDown
target: panel_loader
property: "height"
duration: 200
from: panel_loader.height
to: 0
easing.type: Easing.InOutQuad
}
} }
RowLayout { RowLayout {
id:row
anchors.fill: statusbar anchors.fill: statusbar
spacing: root.height/4 spacing: root.height/4
property var currentChild
StatusbarItem { StatusbarItem {
iconSize: root.height/2 iconSize: root.height/2
source: (cellularSignalBars.value > 0) ? "image://theme/icon_cell" + cellularSignalBars.value : "image://theme/icon_cell1" source: (cellularSignalBars.value > 0) ? "image://theme/icon_cell" + cellularSignalBars.value : "image://theme/icon_cell1"
......
import QtQuick 2.6 import QtQuick 2.6
import QtQuick.Controls.Nemo 1.0 import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
import org.nemomobile.notifications 1.0
MouseArea { MouseArea {
id: notifyArea id: notifyArea
......
...@@ -10,6 +10,11 @@ StatusbarItem { ...@@ -10,6 +10,11 @@ StatusbarItem {
id: batteryChargePercentage id: batteryChargePercentage
key: "Battery.ChargePercentage" key: "Battery.ChargePercentage"
value: "100" value: "100"
onValueChanged: {
if(batteryStateContextProperty.value != "charging") {
chargeIcon();
}
}
} }
ContextProperty { ContextProperty {
......
...@@ -46,9 +46,10 @@ Rectangle { ...@@ -46,9 +46,10 @@ Rectangle {
onClick: { onClick: {
panel_loader.sourceComponent = parent.panel panel_loader.sourceComponent = parent.panel
panel_loader.visible = !panel_loader.visible panel_loader.visible = !panel_loader.visible
row.currentChild=null
} }
height: 240 height: Theme.itemWidthMedium
width: root.width width: root.width
color: "transparent" color: "transparent"
...@@ -80,7 +81,7 @@ Rectangle { ...@@ -80,7 +81,7 @@ Rectangle {
id: actionColumn id: actionColumn
anchors{ anchors{
top: commonPanel.top top: commonPanel.top
topMargin: 20 topMargin: Theme.itemSpacingLarge
} }
width: parent.width width: parent.width
Label{ Label{
...@@ -88,7 +89,7 @@ Rectangle { ...@@ -88,7 +89,7 @@ Rectangle {
text: name text: name
anchors{ anchors{
left: actionColumn.left left: actionColumn.left
leftMargin: 20 leftMargin: Theme.itemSpacingLarge
} }
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.pointSize: 8 font.pointSize: 8
...@@ -101,7 +102,7 @@ Rectangle { ...@@ -101,7 +102,7 @@ Rectangle {
visible: enabled visible: enabled
anchors{ anchors{
right: actionColumn.right right: actionColumn.right
rightMargin: 20 rightMargin: Theme.itemSpacingLarge
verticalCenter: nameLabel.verticalCenter verticalCenter: nameLabel.verticalCenter
} }
} }
...@@ -109,12 +110,30 @@ Rectangle { ...@@ -109,12 +110,30 @@ Rectangle {
Column{ Column{
id: dataColumn id: dataColumn
width: parent.width-40 width: parent.width-settingsIcon.width
anchors{ anchors{
left: parent.left left: parent.left
leftMargin: 20 leftMargin: Theme.itemSpacingLarge
top: actionColumn.bottom top: actionColumn.bottom
topMargin: 60 topMargin: Theme.itemSpacingHuge*1.5
}
}
//Just placeholder until IconButton will get merged
Image {
id:settingsIcon
fillMode: Image.PreserveAspectFit
height: Theme.itemHeightMedium
visible: parent.height > Theme.itemSpacingMedium
source: "image://theme/icon-app-settings" //maybe better icon? settings.png from statusbar spec
anchors{
right: parent.right
rightMargin: Theme.itemSpacingLarge
bottom:parent.bottom
bottomMargin: Theme.itemSpacingLarge
}
MouseArea {
anchors.fill:parent
onClicked: console.log("open right settings page...")
} }
} }
Connections { Connections {
......
...@@ -9,6 +9,17 @@ Item { ...@@ -9,6 +9,17 @@ Item {
property double iconSize property double iconSize
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
function clicked() {
if (panel_source !== "" && !panel) {
panel_loader.source = panel_source
panel_loader.visible = !panel_loader.visible
}
if (panel && panel_source === "") {
panel_loader.sourceComponent = panel
panel_loader.visible = !panel_loader.visible
}
}
Rectangle{ Rectangle{
anchors.fill:parent anchors.fill:parent
opacity: 0.8 opacity: 0.8
...@@ -25,16 +36,8 @@ Item { ...@@ -25,16 +36,8 @@ Item {
MouseArea { MouseArea {
id:mouse id:mouse
anchors.fill: parent anchors.fill: parent
onClicked: { enabled: !lockscreenVisible()
if (panel_source !== "" && !panel) { onClicked: parent.clicked()
panel_loader.source = panel_source
panel_loader.visible = !panel_loader.visible
}
if (panel && panel_source === "") {
panel_loader.sourceComponent = panel
panel_loader.visible = !panel_loader.visible
}
}
} }
} }
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