Commit 354a94dd authored by Aleksi Suomalainen's avatar Aleksi Suomalainen Committed by GitHub

Merge pull request #63 from eekkelund/applauncher_fixes

[AppLauncher] Fixes and improvements for homescreen and statusbar
parents 4dd1e103 807b9751
...@@ -207,6 +207,7 @@ GridView { ...@@ -207,6 +207,7 @@ GridView {
property color color2: "#80ff0000" property color color2: "#80ff0000"
property color color3: "#4Dff0000" property color color3: "#4Dff0000"
property alias text: removeLabel.text property alias text: removeLabel.text
anchors.left: parent.left
visible: gridview.onUninstall visible: gridview.onUninstall
height: Theme.itemHeightExtraLarge height: Theme.itemHeightExtraLarge
width: gridview.width / 2 width: gridview.width / 2
...@@ -215,19 +216,32 @@ GridView { ...@@ -215,19 +216,32 @@ GridView {
GradientStop { position: 0.5; color: remove.color2 } GradientStop { position: 0.5; color: remove.color2 }
GradientStop { position: 1.0; color: remove.color3 } GradientStop { position: 1.0; color: remove.color3 }
} }
Row {
width: parent.width
height: parent.height
Image {
id:removeIcon
fillMode: Image.PreserveAspectFit
height: parent.height -Theme.itemSpacingExtraSmall
width: height
anchors.verticalCenter: parent.verticalCenter
source: "image://theme/remove"
visible: deleter.state != "remove"
}
Label { Label {
id: removeLabel id: removeLabel
height: parent.height
width: parent.width
anchors.centerIn: parent
text: qsTr("Remove") text: qsTr("Remove")
height: parent.height
width: parent.width - (removeIcon.visible ? removeIcon.width : 0)
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
elide:Text.ElideRight elide:Text.ElideRight
horizontalAlignment:Text.AlignHCenter horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter verticalAlignment:Text.AlignVCenter
} }
} }
}
Rectangle { Rectangle {
id: uninstall id: uninstall
property color color1: "#D9ff0000" property color color1: "#D9ff0000"
...@@ -243,11 +257,23 @@ GridView { ...@@ -243,11 +257,23 @@ GridView {
GradientStop { position: 0.5; color: uninstall.color2 } GradientStop { position: 0.5; color: uninstall.color2 }
GradientStop { position: 1.0; color: uninstall.color3 } GradientStop { position: 1.0; color: uninstall.color3 }
} }
Row {
width: parent.width
height: parent.height
Image {
id:trashIcon
fillMode: Image.PreserveAspectFit
height: parent.height -Theme.itemSpacingExtraSmall
width: height
anchors.verticalCenter: parent.verticalCenter
source: "image://theme/trash"
visible: deleter.state != "uninstall"
}
Label { Label {
id: uninstallLabel id: uninstallLabel
height: parent.height height: parent.height
width: parent.width width: parent.width - (trashIcon.visible ? trashIcon.width : 0)
anchors.centerIn: parent anchors.verticalCenter: parent.verticalCenter
text: qsTr("Uninstall") text: qsTr("Uninstall")
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
elide:Text.ElideRight elide:Text.ElideRight
...@@ -256,6 +282,7 @@ GridView { ...@@ -256,6 +282,7 @@ GridView {
} }
} }
} }
}
onFolderIndexChanged: if (folderIndex == -1) newFolderActive = false onFolderIndexChanged: if (folderIndex == -1) newFolderActive = false
......
...@@ -46,6 +46,7 @@ Item { ...@@ -46,6 +46,7 @@ Item {
closeMode = false; closeMode = false;
} }
} }
clip: true
// Empty switcher indicator // Empty switcher indicator
Rectangle { Rectangle {
id: topText id: topText
...@@ -73,11 +74,12 @@ Item { ...@@ -73,11 +74,12 @@ Item {
Flickable { Flickable {
id: flickable id: flickable
contentHeight: gridview.height contentHeight: gridview.height
width: closeMode ? parent.width - 20 : parent.width // see comment re right anchor below width: closeMode ? parent.width - Theme.itemSpacingLarge : parent.width // see comment re right anchor below
MouseArea { MouseArea {
height: flickable.contentHeight > flickable.height ? flickable.contentHeight : flickable.height height: flickable.contentHeight > flickable.height ? flickable.contentHeight : flickable.height
width: flickable.width width: flickable.width
onPressAndHold: closeMode = !closeMode onPressAndHold: closeMode = !closeMode
enabled: gridRepeater.count > 0
onClicked: { onClicked: {
if (closeMode) if (closeMode)
closeMode = false closeMode = false
...@@ -86,17 +88,17 @@ Item { ...@@ -86,17 +88,17 @@ Item {
anchors { anchors {
top: parent.top top: parent.top
topMargin: closeMode ? 20 : 0 topMargin: closeMode ? Theme.itemSpacingLarge : 0
bottom: toolBar.top bottom: toolBar.top
left: parent.left left: parent.left
// no right anchor to avoid double margin (complicated math) // no right anchor to avoid double margin (complicated math)
leftMargin: closeMode ? 20 : 0 leftMargin: closeMode ? Theme.itemSpacingLarge : 0
} }
Grid { Grid {
id: gridview id: gridview
columns: 2 columns: 2
spacing: closeMode ? 20 : 0 spacing: closeMode ? Theme.itemSpacingLarge : 0
move: Transition { move: Transition {
NumberAnimation { NumberAnimation {
properties: "x,y" properties: "x,y"
...@@ -129,76 +131,118 @@ Item { ...@@ -129,76 +131,118 @@ Item {
} }
} }
Connections {
target:gridRepeater
onCountChanged: {
if(gridRepeater.count < 1) {
closeMode = false
}
}
}
Connections {
target: Lipstick.compositor
onDisplayOff: {
closeMode = false
}
}
Connections {
target: lockScreen
onVisibleChanged: {
if(lockscreenVisible()) {
closeMode = false
}
}
}
Connections {
target: pager
onFlickEnded: {
closeMode = false
}
}
Rectangle { Rectangle {
id: toolBar id: toolBar
color: 'black' color: Theme.backgroundColor
border { border {
width: 1 width: 1
color: '#333333' color: Theme.fillDarkColor
} }
z: 202 z: 202
height: toolBarDone.height + 2*padding height:Theme.itemHeightExtraLarge + 2*padding
property int padding: 9 property int padding: Theme.itemSpacingSmall
anchors { anchors {
left: parent.left left: parent.left
right: parent.right right: parent.right
bottom: parent.bottom bottom: parent.bottom
margins: -1 margins: -1
bottomMargin: switcherRoot.closeMode ? 48 : -height bottomMargin: switcherRoot.closeMode ? statusbar.height : -height
} }
Behavior on anchors.bottomMargin { PropertyAnimation { duration: 100 } } Behavior on anchors.bottomMargin { PropertyAnimation { duration: 100 } }
Row {
anchors {
top: parent.top
margins: toolBar.padding
right: parent.right
left: parent.left
bottom: parent.bottom
}
spacing: toolBar.padding*2
Button { Button {
id: toolBarDone id: toolBarDone
width: parent.width / 3
height: width
anchors { anchors {
top: parent.top top: parent.top
topMargin: toolBar.padding bottom: parent.bottom
right: parent.horizontalCenter
rightMargin: toolBar.padding
} }
width: parent.width / 2 - toolBar.padding
onClicked: { onClicked: {
switcherRoot.closeMode = false; switcherRoot.closeMode = false;
} }
text: qsTr("Done")
//Untill fontSizes are fixed
style: ButtonStyle { style: ButtonStyle {
label: Label { label: Text {
text: "Done" renderType: Text.NativeRendering
anchors.fill: parent
anchors.margins: 10
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
fontSizeMode: Text.HorizontalFit horizontalAlignment: Text.AlignHCenter
anchors.centerIn: parent text: control.text
color: Theme.textColor
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSizeMedium
font.weight: control.primary ? Theme.fontWeightLarge : Theme.fontWeightMedium
opacity: control.enabled ? 1.0 : 0.3
} }
} }
} }
Button { Button {
id: toolBarCloseAll id: toolBarCloseAll
width: toolBarDone.width
height: width
anchors { anchors {
top: parent.top top: parent.top
topMargin: toolBar.padding bottom: parent.bottom
left: parent.horizontalCenter
leftMargin: toolBar.padding
} }
width: parent.width / 2 - toolBar.padding
onClicked: { onClicked: {
// TODO: use close animation inside item // TODO: use close animation inside item
for (var i = gridRepeater.count - 1; i >= 0; i--) { for (var i = gridRepeater.count - 1; i >= 0; i--) {
gridRepeater.itemAt(i).close() gridRepeater.itemAt(i).close()
} }
} }
text: qsTr("Close All")
//Untill fontSizes are fixed
style: ButtonStyle { style: ButtonStyle {
label: Label { label: Text {
text: qsTr("Close\nAll") renderType: Text.NativeRendering
anchors.margins: 10
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
fontSizeMode: Text.Fit horizontalAlignment: Text.AlignHCenter
anchors.centerIn: parent text: control.text
color: Theme.textColor
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSizeMedium
font.weight: control.primary ? Theme.fontWeightLarge : Theme.fontWeightMedium
opacity: control.enabled ? 1.0 : 0.3
}
} }
} }
} }
......
...@@ -169,7 +169,7 @@ Page { ...@@ -169,7 +169,7 @@ Page {
width: parent.width width: parent.width
height: parent.height height: parent.height
z: 200 z: 200
}
DeviceLockUI { DeviceLockUI {
id: codePad id: codePad
visible: DeviceLock.state == DeviceLock.Locked && codepadVisible visible: DeviceLock.state == DeviceLock.Locked && codepadVisible
...@@ -181,5 +181,6 @@ Page { ...@@ -181,5 +181,6 @@ Page {
z: 200 z: 200
} }
}
} }
...@@ -57,9 +57,8 @@ Item { ...@@ -57,9 +57,8 @@ Item {
id:margin id:margin
height: Theme.itemSpacingSmall height: Theme.itemSpacingSmall
} }
Row {
TextField { id:searchRow
id:searchField
anchors { anchors {
top:margin.bottom top:margin.bottom
left: parent.left left: parent.left
...@@ -69,12 +68,25 @@ Item { ...@@ -69,12 +68,25 @@ Item {
rightMargin: Theme.itemSpacingMedium rightMargin: Theme.itemSpacingMedium
bottomMargin:Theme.itemSpacingHuge bottomMargin:Theme.itemSpacingHuge
} }
Image {
id:searchIcon
anchors.verticalCenter: parent.verticalCenter
width:height
height: searchField.height
fillMode: Image.PreserveAspectFit
source: "image://theme/search"
}
TextField {
id:searchField
width:parent.width - searchIcon.width - Theme.itemSpacingMedium
placeholderText: qsTr("Search")
Binding { Binding {
target: gridview target: gridview
property: "searchString" property: "searchString"
value: searchField.text.toLowerCase().trim() value: searchField.text.toLowerCase().trim()
} }
}
} }
ListView { ListView {
...@@ -82,7 +94,7 @@ Item { ...@@ -82,7 +94,7 @@ Item {
clip: true clip: true
width: parent.width width: parent.width
height:contentHeight height:contentHeight
anchors.top: searchField.bottom anchors.top: searchRow.bottom
anchors.topMargin: Theme.itemSpacingSmall anchors.topMargin: Theme.itemSpacingSmall
visible: searchString.length>0 visible: searchString.length>0
section.property: 'category' section.property: 'category'
...@@ -152,7 +164,7 @@ Item { ...@@ -152,7 +164,7 @@ Item {
requiredProperty: PeopleModel.PhoneNumberRequired requiredProperty: PeopleModel.PhoneNumberRequired
} }
//Orginal function ** Copyright (C) 2013 Jolla Ltd. ** Contact: Joona Petrell <joona.petrell@jollamobile.com> //Orginal function ** Copyright (C) 2013 Jolla Ltd. ** Contact: Joona Petrell <joona.petrell@jollamobile.com> **BSD
//Function has been modified //Function has been modified
function update() { function update() {
if(searchString.length<1) { if(searchString.length<1) {
......
...@@ -31,6 +31,18 @@ MouseArea { ...@@ -31,6 +31,18 @@ MouseArea {
id: switcherItemRoot id: switcherItemRoot
property bool rotateWindowContent: desktop.isPortrait property bool rotateWindowContent: desktop.isPortrait
property int desktopAngle: {
switch(desktop.orientation) {
case Qt.PortraitOrientation:
return 0
case Qt.InvertedPortraitOrientation:
return 180
case Qt.LandscapeOrientation:
return 270
case Qt.InvertedLandscapeOrientation:
return 90
}
}
WindowPixmapItem { WindowPixmapItem {
id: windowPixmap id: windowPixmap
...@@ -38,9 +50,9 @@ MouseArea { ...@@ -38,9 +50,9 @@ MouseArea {
height: rotateWindowContent ? parent.height : parent.width height: rotateWindowContent ? parent.height : parent.width
windowId: model.window windowId: model.window
transform: Rotation { transform: Rotation {
angle: rotateWindowContent ? 0 : 90 angle:desktopAngle
origin.x: windowPixmap.height / 2 origin.x: rotateWindowContent ? windowPixmap.width / 2 : angle === 270 ? windowPixmap.width / 2 : windowPixmap.height / 2
origin.y: windowPixmap.height / 2 origin.y: rotateWindowContent ? windowPixmap.height / 2 : angle === 270 ? windowPixmap.width / 2 : windowPixmap.height / 2
} }
smooth: true smooth: true
radius: 5 radius: 5
...@@ -55,6 +67,8 @@ MouseArea { ...@@ -55,6 +67,8 @@ MouseArea {
onClicked: { onClicked: {
if (!switcherRoot.closeMode) { if (!switcherRoot.closeMode) {
Lipstick.compositor.windowToFront(model.window); Lipstick.compositor.windowToFront(model.window);
} else {
switcherRoot.closeMode = false
} }
} }
......
...@@ -32,16 +32,126 @@ ...@@ -32,16 +32,126 @@
import QtQuick 2.1 import QtQuick 2.1
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 QtQuick.Layouts 1.0
import org.nemomobile.dbus 2.0
Component { Component {
CommonPanel { CommonPanel {
name: qsTr("Battery"); name: qsTr("Battery");
switcherEnabled: false switcherEnabled: false
ColumnLayout {
anchors.fill: parent
spacing: Theme.itemSpacingSmall
Label { Label {
id:percentageLabel
text: qsTr("Level")+ ": " + batteryChargePercentage.value + "%" text: qsTr("Level")+ ": " + batteryChargePercentage.value + "%"
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeSmall
anchors.centerIn: parent anchors.leftMargin: Theme.itemSpacingSmall
anchors.horizontalCenter: parent.horizontalCenter
}
Item {
id:powerSaveWrapper
//Copyright Andrey Kozhevnikov https://github.com/CODeRUS/jolla-settings-powersave/blob/master/settings/mainpage.qml
Layout.fillWidth: true
Layout.fillHeight: true
property string key_threshold_value: "/system/osso/dsm/energymanagement/psm_threshold"
property string key_powersave_enable: "/system/osso/dsm/energymanagement/enable_power_saving"
property string key_powersave_force: "/system/osso/dsm/energymanagement/force_power_saving"
property variant threshold_value
property variant powersave_enable
property variant powersave_force
property var values: {
"/system/osso/dsm/energymanagement/psm_threshold": 50,
"/system/osso/dsm/energymanagement/enable_power_saving": true,
"/system/osso/dsm/energymanagement/force_power_saving": true
}
DBusInterface {
id: mceRequestIface
service: 'com.nokia.mce'
path: '/com/nokia/mce/request'
iface: 'com.nokia.mce.request'
bus: DBus.SystemBus
function setValue(key, value) {
typedCall('set_config', [{"type":"s", "value":key}, {"type":"v", "value":value}])
}
function getValue(key) {
typedCall('get_config', [{"type":"s", "value":key}], function (value) {
var temp = powerSaveWrapper.values
temp[key] = value
powerSaveWrapper.values = temp
})
}
Component.onCompleted: {
getValue(powerSaveWrapper.key_threshold_value)
getValue(powerSaveWrapper.key_powersave_enable)
getValue(powerSaveWrapper.key_powersave_force)
}
}
DBusInterface {
id: mceSignalIface
service: 'com.nokia.mce'
path: '/com/nokia/mce/signal'
iface: 'com.nokia.mce.signal'
bus: DBus.SystemBus
signalsEnabled: true
function config_change_ind(key, value) {
if (key in powerSaveWrapper.values) {
var temp = powerSaveWrapper.values
temp[key] = value
powerSaveWrapper.values = temp
}
}
}
CheckBox {
id:enablePowerSave
property string entryPath: "system_settings/info/powersave/powersave_enable"
checked: powerSaveWrapper.values[powerSaveWrapper.key_powersave_enable]
text: qsTr("Enable powersave mode")
onClicked: mceRequestIface.setValue(powerSaveWrapper.key_powersave_enable, checked)
}
Slider {
id: powerSaveSlider
width: parent.width -Theme.itemHeightMedium
anchors.top:enablePowerSave.bottom
anchors.topMargin: Theme.itemSpacingSmall
property string entryPath: "system_settings/info/powersave/powersave_threshold"
minimumValue: 1
maximumValue: 99
//label: "Battery threshold"
showValue: true
stepSize: 1
value: powerSaveWrapper.values[powerSaveWrapper.key_threshold_value] ? powerSaveWrapper.values[powerSaveWrapper.key_threshold_value] : 0
onPressedChanged: if(!pressed) mceRequestIface.typedCall('set_config', [{"type": "s", "value": powerSaveWrapper.key_threshold_value},
{"type": "v", "value": parseInt(value)}])
}
CheckBox {
id:forcePowerSave
anchors.top:powerSaveSlider.bottom
anchors.topMargin: Theme.itemSpacingSmall
property string entryPath: "system_settings/info/powersave/powersave_force"
checked: powerSaveWrapper.values[powerSaveWrapper.key_powersave_force]
onClicked: mceRequestIface.setValue(powerSaveWrapper.key_powersave_force, checked)
text: qsTr("Force powersave mode")
}
}
} }
} }
} }
...@@ -83,6 +83,7 @@ Rectangle { ...@@ -83,6 +83,7 @@ Rectangle {
top: commonPanel.top top: commonPanel.top
topMargin: Theme.itemSpacingLarge topMargin: Theme.itemSpacingLarge
} }
height: nameLabel.height
width: parent.width width: parent.width
Label{ Label{
id: nameLabel id: nameLabel
...@@ -115,7 +116,7 @@ Rectangle { ...@@ -115,7 +116,7 @@ Rectangle {
left: parent.left left: parent.left
leftMargin: Theme.itemSpacingLarge leftMargin: Theme.itemSpacingLarge
top: actionColumn.bottom top: actionColumn.bottom
topMargin: Theme.itemSpacingHuge*1.5 topMargin: Theme.itemSpacingMedium
} }
} }
//Just placeholder until IconButton will get merged //Just placeholder until IconButton will get merged
......
...@@ -139,7 +139,7 @@ Component { ...@@ -139,7 +139,7 @@ Component {
visible: !needsPin visible: !needsPin
text: qsTr("No pin required!") text: qsTr("No pin required!")
font.pixelSize:Theme.fontSizeMedium font.pixelSize:Theme.fontSizeMedium
anchors.centerIn: parent anchors.horizontalCenter: parent.horizontalCenter
} }
} }
} }
...@@ -54,6 +54,7 @@ Component { ...@@ -54,6 +54,7 @@ Component {
] ]
Repeater { Repeater {
anchors.top: parent.top
model: wifimodel model: wifimodel
delegate: Item { delegate: Item {
width: wifiPanel.width width: wifiPanel.width
......
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