Commit d86b263d authored by eekkelund's avatar eekkelund

[StatusBar] Moving towards spec. Wifi, MouseArea & InverseMouseArea. ...

[StatusBar] Moving towards spec. Wifi, MouseArea & InverseMouseArea.  [AppLauncher][Notifications] Bug and aesthetical fixes.
parent 874f0d56
...@@ -70,7 +70,7 @@ GridView { ...@@ -70,7 +70,7 @@ GridView {
target: headerItem target: headerItem
onHeightChanged:{ onHeightChanged:{
if(headerItem.oldHeight < headerItem.height) if(headerItem.oldHeight < headerItem.height)
gridview.contentY = headerItem.y if(!flicking) gridview.contentY = headerItem.y
headerItem.oldHeight = headerItem.height headerItem.oldHeight = headerItem.height
} }
onVisibleChanged:timer.restart() onVisibleChanged:timer.restart()
...@@ -117,7 +117,7 @@ GridView { ...@@ -117,7 +117,7 @@ GridView {
} }
footer: Item { footer: Item {
height: Math.min(parent.width,parent.height)/10 height: Theme.itemHeightLarge*1.5
} }
Item {//Doesn't yet uninstall applications Item {//Doesn't yet uninstall applications
......
...@@ -44,7 +44,7 @@ Flickable { ...@@ -44,7 +44,7 @@ Flickable {
Rectangle { Rectangle {
id: daterow id: daterow
height: Theme.itemHeightMedium height: Theme.itemHeightMedium
width: childrenRect.width width: parent.width
anchors{ anchors{
top: parent.top top: parent.top
......
...@@ -81,6 +81,11 @@ Item { ...@@ -81,6 +81,11 @@ Item {
width:/*launcherItem.notNemoIcon ? parent.width-parent.width/3 : */parent.width - parent.width/4 width:/*launcherItem.notNemoIcon ? parent.width-parent.width/3 : */parent.width - parent.width/4
height: width height: width
asynchronous: true asynchronous: true
onStatusChanged: {
if (iconImage.status == Image.Error) {
iconImage.source = "/usr/share/lipstick-glacier-home-qt5/qml/theme/default-icon.png"
}
}
} }
Spinner { Spinner {
id: spinnerr id: spinnerr
......
...@@ -63,15 +63,12 @@ Item { ...@@ -63,15 +63,12 @@ Item {
clip: true clip: true
onClicked: { onClicked: {
// TODO: disallow if close mode enabled // TODO: disallow if close mode enabled
if (modelData.object.type !== LauncherModel.Folder) { if (modelData.object.type === LauncherModel.Folder) {
var winId = switcher.switchModel.getWindowIdForTitle(modelData.object.title) if(folderLoader.count>0 || reopenTimer.running) {
if (winId == 0 || !modelData.object.isLaunching) folderLoader.model = 0
modelData.object.launchApplication()
else
Lipstick.compositor.windowToFront(winId)
} else { } else {
folderLoader.model = modelData.object folderLoader.model = modelData.object
//folderLoader.visible = true }
} }
} }
Item { Item {
...@@ -129,7 +126,7 @@ Item { ...@@ -129,7 +126,7 @@ Item {
height: folderIconStack.iconSize height: folderIconStack.iconSize
opacity: folderIconStack.transparency opacity: folderIconStack.transparency
anchors.centerIn: parent anchors.centerIn: parent
visible: icons.length > 0 visible: folderIconStack.icons.length > 0
source: visible ? folderIconStack.icons[0]: "" source: visible ? folderIconStack.icons[0]: ""
} }
Text{ Text{
...@@ -146,7 +143,7 @@ Item { ...@@ -146,7 +143,7 @@ Item {
Text { Text {
id: iconText id: iconText
// elide only works if an explicit width is set // elide only works if an explicit width is set
width: iconWrapper.width width: launcherItem.width
elide: Text.ElideRight elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
...@@ -185,6 +182,7 @@ Item { ...@@ -185,6 +182,7 @@ Item {
height: count == 0 ? 0 : (Math.floor((count*wrapper.height-1)/width) + 1) * wrapper.height height: count == 0 ? 0 : (Math.floor((count*wrapper.height-1)/width) + 1) * wrapper.height
cellWidth: wrapper.width cellWidth: wrapper.width
cellHeight: wrapper.width cellHeight: wrapper.width
onReorderItemChanged: if(reorderItem == null) folderIconStack.icons=folderIconStack.addIcons()
Rectangle { Rectangle {
width: parent.width width: parent.width
...@@ -209,15 +207,12 @@ Item { ...@@ -209,15 +207,12 @@ Item {
iconCaption.text: model.object.title iconCaption.text: model.object.title
iconCaption.color: Theme.backgroundColor iconCaption.color: Theme.backgroundColor
folderModel:folderLoader.model folderModel:folderLoader.model
onReorderingChanged: if(!reordering) folderIconStack.icons=folderIconStack.addIcons()
visible: false
} }
Behavior on height { Behavior on height {
NumberAnimation { NumberAnimation {
easing.type: Easing.InQuad easing.type: Easing.InQuad
duration: 100 duration: 100
onRunningChanged: if(!running && folderLoader.count>0) folderLauncherItem.visible = true
} }
} }
} }
...@@ -233,12 +228,17 @@ Item { ...@@ -233,12 +228,17 @@ Item {
InverseMouseArea { InverseMouseArea {
anchors.fill: folderLoader anchors.fill: folderLoader
enabled: folderLoader.visible && folderLoader.count > 0 enabled: folderLoader.visible && folderLoader.count > 0
parent:folderLoader.contentItem parent: folderLoader.contentItem
onPressed: { onPressed: {
folderLoader.model = 0 folderLoader.model = 0
reopenTimer.start()
} }
} }
Timer {
id: reopenTimer
interval: 300
running: false
}
} }
...@@ -194,7 +194,7 @@ MouseArea { ...@@ -194,7 +194,7 @@ MouseArea {
enabled = true enabled = true
} }
} }
NumberAnimation { id:deleteAnimation; target: iconWrapper; property: "opacity"; to: 0.2; duration: 3000;}//Just placeholder to get visual feedback NumberAnimation { id:deleteAnimation; target: typeof iconWrapper !== 'undefined' ? iconWrapper : parent; property: "opacity"; to: 0.2; duration: 3000;}//Just placeholder to get visual feedback
Timer { Timer {
id: reorderTimer id: reorderTimer
......
...@@ -85,6 +85,39 @@ Item { ...@@ -85,6 +85,39 @@ Item {
anchors.topMargin: Theme.itemSpacingSmall anchors.topMargin: Theme.itemSpacingSmall
visible: searchString.length>0 visible: searchString.length>0
section.property: 'category' section.property: 'category'
section.delegate: Component{
id: sectionHeading
Rectangle {
width: listView.width
height: Theme.itemHeightMedium
color: "transparent"
Text {
id: sectionText
text: section
font.capitalization: Font.AllUppercase
font.pixelSize: Theme.fontSizeMedium
color: Theme.textColor
anchors{
left: parent.left
leftMargin: Theme.itemSpacingSmall
verticalCenter: parent.verticalCenter
}
}
Rectangle{
id: line
height: 1
color: Theme.textColor
width: listView.width-sectionText.width-Theme.itemHeightExtraSmall
anchors{
left: sectionText.right
leftMargin: Theme.itemSpacingSmall
verticalCenter: sectionText.verticalCenter
}
}
}
}
Behavior on height { Behavior on height {
NumberAnimation{ duration: 300 } NumberAnimation{ duration: 300 }
......
...@@ -42,7 +42,7 @@ import "statusbar" ...@@ -42,7 +42,7 @@ import "statusbar"
Item { Item {
id: root id: root
z: 201 z: 201
height: Theme.itemHeightMedium height: Theme.itemHeightLarge
width: parent.width width: parent.width
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
...@@ -53,17 +53,21 @@ Item { ...@@ -53,17 +53,21 @@ Item {
opacity: 0.5 opacity: 0.5
z: 200 z: 200
} }
//Just to capture clicks that don't hit statusbaritem
MouseArea {
anchors.fill: parent
}
Connections { Connections {
target: lipstickSettings; target: lipstickSettings;
onLockscreenVisibleChanged: { onLockscreenVisibleChanged: {
if(lipstickSettings.lockscreenVisible) { if(lipstickSettings.lockscreenVisible) {
batteryChargePercentage.subscribe() batteryIndicator.batteryChargePercentage.subscribe()
cellularSignalBars.subscribe() cellularSignalBars.subscribe()
cellularRegistrationStatus.subscribe() cellularRegistrationStatus.subscribe()
cellularNetworkName.subscribe() cellularNetworkName.subscribe()
cellularDataTechnology.subscribe() cellularDataTechnology.subscribe()
} else { } else {
batteryChargePercentage.unsubscribe() batteryIndicator.batteryChargePercentage.unsubscribe()
cellularSignalBars.unsubscribe() cellularSignalBars.unsubscribe()
cellularRegistrationStatus.unsubscribe() cellularRegistrationStatus.unsubscribe()
cellularNetworkName.unsubscribe() cellularNetworkName.unsubscribe()
...@@ -196,8 +200,10 @@ Item { ...@@ -196,8 +200,10 @@ Item {
} else if (networkManager.defaultRoute.strength >= 40) { } else if (networkManager.defaultRoute.strength >= 40) {
return "image://theme/icon_wifi_focused1" return "image://theme/icon_wifi_focused1"
} else { } else {
return "image://theme/icon_wifi_normal4" return "image://theme/icon_wifi_0"
} }
} else if (wifimodel.powered && !wlan.connected) {
return "image://theme/icon_wifi_touch"
} else { } else {
return "image://theme/icon_wifi_0" return "image://theme/icon_wifi_0"
} }
...@@ -224,6 +230,7 @@ Item { ...@@ -224,6 +230,7 @@ Item {
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2 iconSize: root.height/2
anchors.verticalCenter: parent.verticalCenter
Label { Label {
id: hours id: hours
width: root.height/4 width: root.height/4
...@@ -242,6 +249,8 @@ Item { ...@@ -242,6 +249,8 @@ Item {
} }
} }
BatteryIndicator{} BatteryIndicator{
id:batteryIndicator
}
} }
} }
import QtQuick 2.0 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
...@@ -8,11 +10,49 @@ MouseArea { ...@@ -8,11 +10,49 @@ MouseArea {
height: childrenRect.height height: childrenRect.height
width: rootitem.width width: rootitem.width
drag.target: notifyArea
drag.axis: Drag.XAxis
drag.minimumX: 0-Theme.itemHeightMedium
drag.maximumX: notifyArea.width
drag.onActiveChanged: {
if(!drag.active ) {
if((notifyArea.x > notifyArea.width/3)) {
slideAnimation.start()
}else slideBackAnimation.start()
}
}
onClicked: { onClicked: {
if (modelData.userRemovable) { if (modelData.userRemovable) {
modelData.actionInvoked("default") slideAnimation.start()
} }
} }
NumberAnimation {
id:slideAnimation
target: notifyArea
property: "x"
duration: 200
from: notifyArea.x
to: notifyArea.width
easing.type: Easing.InOutQuad
onStopped: modelData.actionInvoked("default")
}
NumberAnimation {
id:slideBackAnimation
target: notifyArea
property: "x"
duration: 200
from: notifyArea.x
to: 0
easing.type: Easing.InOutQuad
}
Rectangle {
anchors.fill: parent
color: "#11ffffff"
visible: notifyArea.pressed
radius: Theme.itemSpacingMedium
}
Image { Image {
id: appIcon id: appIcon
...@@ -26,7 +66,6 @@ MouseArea { ...@@ -26,7 +66,6 @@ MouseArea {
} }
source: { source: {
console.log(modelData, modelData.icon)
if (modelData.icon) if (modelData.icon)
return "image://theme/" + modelData.icon return "image://theme/" + modelData.icon
else else
......
...@@ -4,6 +4,7 @@ import org.freedesktop.contextkit 1.0 ...@@ -4,6 +4,7 @@ import org.freedesktop.contextkit 1.0
StatusbarItem { StatusbarItem {
id: batteryIndicator id: batteryIndicator
property int chargeValue: 0 property int chargeValue: 0
property alias batteryChargePercentage: batteryChargePercentage
ContextProperty { ContextProperty {
id: batteryChargePercentage id: batteryChargePercentage
...@@ -17,8 +18,13 @@ StatusbarItem { ...@@ -17,8 +18,13 @@ StatusbarItem {
onValueChanged: { onValueChanged: {
if(batteryStateContextProperty.value == "charging") if(batteryStateContextProperty.value == "charging")
{ {
if (batteryChargePercentage.value === 100) {
chargingTimer.stop()
chargeIcon()
}else {
chargingTimer.start() chargingTimer.start()
} }
}
else else
{ {
chargingTimer.stop() chargingTimer.stop()
......
...@@ -40,7 +40,7 @@ Component { ...@@ -40,7 +40,7 @@ Component {
Label { Label {
text: qsTr("Level")+ ": " + batteryChargePercentage.value + "%" text: qsTr("Level")+ ": " + batteryChargePercentage.value + "%"
font.pointSize: 8 font.pixelSize: Theme.fontSizeMedium
anchors.centerIn: parent anchors.centerIn: parent
} }
} }
......
...@@ -34,6 +34,7 @@ import QtQuick 2.0 ...@@ -34,6 +34,7 @@ import QtQuick 2.0
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
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.lipstick 0.1
Rectangle { Rectangle {
id: commonPanel id: commonPanel
...@@ -41,6 +42,11 @@ Rectangle { ...@@ -41,6 +42,11 @@ Rectangle {
property alias switcherEnabled: columnCheckBox.enabled property alias switcherEnabled: columnCheckBox.enabled
property alias switcherChecked: columnCheckBox.checked property alias switcherChecked: columnCheckBox.checked
property string name: "" property string name: ""
signal click
onClick: {
panel_loader.sourceComponent = parent.panel
panel_loader.visible = !panel_loader.visible
}
height: 240 height: 240
width: root.width width: root.width
...@@ -50,6 +56,20 @@ Rectangle { ...@@ -50,6 +56,20 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
color: "#313131" color: "#313131"
opacity: 0.3 opacity: 0.3
}
InverseMouseArea {
anchors.fill: parent
enabled: parent.visible
onPressed: {
parent.click()
}
}
MouseArea {
id:mouseArea
anchors.fill:parent
onClicked: parent.click()
} }
clip: true clip: true
...@@ -97,4 +117,28 @@ Rectangle { ...@@ -97,4 +117,28 @@ Rectangle {
topMargin: 60 topMargin: 60
} }
} }
Connections {
target: lockScreen
onVisibleChanged: {
if(lockscreenVisible()) {
panel_loader.visible = false
}
}
}
Connections {
target: Lipstick.compositor
onDisplayOff: {
panel_loader.visible = false
}
onWindowAdded: {
if(window.category=="" && window.title !== "Home"){
panel_loader.visible = false
}
}
onWindowRaised: {
if(window.category=="" && window.title !== "Home"){
panel_loader.visible = false
}
}
}
} }
...@@ -68,7 +68,7 @@ Component { ...@@ -68,7 +68,7 @@ Component {
anchors.fill: simpanel anchors.fill: simpanel
spacing: 0 spacing: 0
RowLayout { RowLayout {
spacing: 16 spacing: Theme.itemSpacingMedium
TextField { TextField {
id: pinquery id: pinquery
width: 140 width: 140
...@@ -138,7 +138,7 @@ Component { ...@@ -138,7 +138,7 @@ Component {
Label { Label {
visible: !needsPin visible: !needsPin
text: qsTr("No pin required!") text: qsTr("No pin required!")
font.pointSize: 16 font.pixelSize:Theme.fontSizeMedium
anchors.centerIn: parent anchors.centerIn: parent
} }
} }
......
...@@ -3,18 +3,27 @@ import QtQuick.Layouts 1.0 ...@@ -3,18 +3,27 @@ import QtQuick.Layouts 1.0
Item { Item {
property alias source: icon.source property alias source: icon.source
property alias pressed: mouse.pressed
property string panel_source property string panel_source
property Component panel property Component panel
property double iconSize property double iconSize
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Rectangle{
anchors.fill:parent
opacity: 0.8
color: Theme.fillDarkColor
visible: panel_loader.visible && (panel_loader.sourceComponent == panel)
}
Image { Image {
width: iconSize fillMode: Image.PreserveAspectFit
height: iconSize height: iconSize
id: icon id: icon
anchors.centerIn: parent anchors.centerIn: parent
} }
MouseArea { MouseArea {
id:mouse
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
if (panel_source !== "" && !panel) { if (panel_source !== "" && !panel) {
...@@ -27,4 +36,5 @@ Item { ...@@ -27,4 +36,5 @@ Item {
} }
} }
} }
} }
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
** **
****************************************************************************************/ ****************************************************************************************/
import QtQuick 2.1 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 MeeGo.Connman 0.2 import MeeGo.Connman 0.2
...@@ -40,7 +40,7 @@ Component { ...@@ -40,7 +40,7 @@ Component {
id: wifiPanel id: wifiPanel
name: "Wifi" name: "Wifi"
switcherEnabled: true switcherEnabled: true
switcherChecked: true switcherChecked: wifimodel.powered
onSwitcherCheckedChanged: { onSwitcherCheckedChanged: {
wifimodel.setPowered(switcherChecked) wifimodel.setPowered(switcherChecked)
...@@ -57,10 +57,9 @@ Component { ...@@ -57,10 +57,9 @@ Component {
model: wifimodel model: wifimodel
delegate: Item { delegate: Item {
width: wifiPanel.width width: wifiPanel.width
height: 40 height: Theme.itemHeightSmall
function getStrengthIndex(strength) { function getStrengthIndex(strength) {
var strengthIndex = "0" var strengthIndex = "0"
if (strength >= 59) { if (strength >= 59) {
strengthIndex = "4" strengthIndex = "4"
} else if (strength >= 55) { } else if (strength >= 55) {
...@@ -73,21 +72,22 @@ Component { ...@@ -73,21 +72,22 @@ Component {
return strengthIndex return strengthIndex
} }
Row { Row {
spacing: 12 spacing: Theme.itemSpacingSmall
Image { Image {
id: statusImage id: statusImage
source: (getStrengthIndex(modelData.strength) === "0")? "image://theme/icon_wifi_0" : "image://theme/icon_wifi_focused" + getStrengthIndex(modelData.strength) source: (getStrengthIndex(modelData.strength) === "0")? "image://theme/icon_wifi_0" : (modelData.state === "online" ? "image://theme/icon_wifi_focused" : "image://theme/icon_wifi_normal")+ getStrengthIndex(modelData.strength)
} }
Label { Label {
anchors{ anchors{
leftMargin: 20 leftMargin: Theme.itemSpacingLarge
verticalCenter: statusImage.verticalCenter verticalCenter: statusImage.verticalCenter
} }
width: root.width width: root.width
font.pointSize: 8 font.pixelSize: Theme.fontSizeMedium
text: modelData.name text: modelData.name
wrapMode: Text.Wrap wrapMode: Text.Wrap
color: modelData.state === "online" ? Theme.accentColor : Theme.textColor
} }
} }
} }
......
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