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