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 {
property color color2: "#80ff0000"
property color color3: "#4Dff0000"
property alias text: removeLabel.text
anchors.left: parent.left
visible: gridview.onUninstall
height: Theme.itemHeightExtraLarge
width: gridview.width / 2
......@@ -215,17 +216,30 @@ GridView {
GradientStop { position: 0.5; color: remove.color2 }
GradientStop { position: 1.0; color: remove.color3 }
}
Label {
id: removeLabel
height: parent.height
Row {
width: parent.width
anchors.centerIn: parent
text: qsTr("Remove")
font.pixelSize: Theme.fontSizeSmall
elide:Text.ElideRight
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
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 {
id: removeLabel
text: qsTr("Remove")
height: parent.height
width: parent.width - (removeIcon.visible ? removeIcon.width : 0)
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: Theme.fontSizeSmall
elide:Text.ElideRight
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
}
}
}
Rectangle {
......@@ -243,16 +257,29 @@ GridView {
GradientStop { position: 0.5; color: uninstall.color2 }
GradientStop { position: 1.0; color: uninstall.color3 }
}
Label {
id: uninstallLabel
height: parent.height
Row {
width: parent.width
anchors.centerIn: parent
text: qsTr("Uninstall")
font.pixelSize: Theme.fontSizeSmall
elide:Text.ElideRight
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
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 {
id: uninstallLabel
height: parent.height
width: parent.width - (trashIcon.visible ? trashIcon.width : 0)
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Uninstall")
font.pixelSize: Theme.fontSizeSmall
elide:Text.ElideRight
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
}
}
}
}
......
......@@ -46,6 +46,7 @@ Item {
closeMode = false;
}
}
clip: true
// Empty switcher indicator
Rectangle {
id: topText
......@@ -73,11 +74,12 @@ Item {
Flickable {
id: flickable
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 {
height: flickable.contentHeight > flickable.height ? flickable.contentHeight : flickable.height
width: flickable.width
onPressAndHold: closeMode = !closeMode
enabled: gridRepeater.count > 0
onClicked: {
if (closeMode)
closeMode = false
......@@ -86,17 +88,17 @@ Item {
anchors {
top: parent.top
topMargin: closeMode ? 20 : 0
topMargin: closeMode ? Theme.itemSpacingLarge : 0
bottom: toolBar.top
left: parent.left
// no right anchor to avoid double margin (complicated math)
leftMargin: closeMode ? 20 : 0
leftMargin: closeMode ? Theme.itemSpacingLarge : 0
}
Grid {
id: gridview
columns: 2
spacing: closeMode ? 20 : 0
spacing: closeMode ? Theme.itemSpacingLarge : 0
move: Transition {
NumberAnimation {
properties: "x,y"
......@@ -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 {
id: toolBar
color: 'black'
color: Theme.backgroundColor
border {
width: 1
color: '#333333'
color: Theme.fillDarkColor
}
z: 202
height: toolBarDone.height + 2*padding
property int padding: 9
height:Theme.itemHeightExtraLarge + 2*padding
property int padding: Theme.itemSpacingSmall
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
margins: -1
bottomMargin: switcherRoot.closeMode ? 48 : -height
bottomMargin: switcherRoot.closeMode ? statusbar.height : -height
}
Behavior on anchors.bottomMargin { PropertyAnimation { duration: 100 } }
Button {
id: toolBarDone
width: parent.width / 3
height: width
Row {
anchors {
top: parent.top
topMargin: toolBar.padding
right: parent.horizontalCenter
rightMargin: toolBar.padding
}
onClicked: {
switcherRoot.closeMode = false;
margins: toolBar.padding
right: parent.right
left: parent.left
bottom: parent.bottom
}
style: ButtonStyle {
label: Label {
text: "Done"
anchors.fill: parent
anchors.margins: 10
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
fontSizeMode: Text.HorizontalFit
anchors.centerIn: parent
spacing: toolBar.padding*2
Button {
id: toolBarDone
anchors {
top: parent.top
bottom: parent.bottom
}
width: parent.width / 2 - toolBar.padding
onClicked: {
switcherRoot.closeMode = false;
}
text: qsTr("Done")
//Untill fontSizes are fixed
style: ButtonStyle {
label: Text {
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
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 {
id: toolBarCloseAll
width: toolBarDone.width
height: width
anchors {
top: parent.top
topMargin: toolBar.padding
left: parent.horizontalCenter
leftMargin: toolBar.padding
}
onClicked: {
// TODO: use close animation inside item
for (var i = gridRepeater.count - 1; i >= 0; i--) {
gridRepeater.itemAt(i).close()
Button {
id: toolBarCloseAll
anchors {
top: parent.top
bottom: parent.bottom
}
}
style: ButtonStyle {
label: Label {
text: qsTr("Close\nAll")
anchors.margins: 10
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
fontSizeMode: Text.Fit
anchors.centerIn: parent
width: parent.width / 2 - toolBar.padding
onClicked: {
// TODO: use close animation inside item
for (var i = gridRepeater.count - 1; i >= 0; i--) {
gridRepeater.itemAt(i).close()
}
}
text: qsTr("Close All")
//Untill fontSizes are fixed
style: ButtonStyle {
label: Text {
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
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,17 +169,18 @@ Page {
width: parent.width
height: parent.height
z: 200
}
DeviceLockUI {
id: codePad
visible: DeviceLock.state == DeviceLock.Locked && codepadVisible
width: lockScreen.width
height:lockScreen.height / 2
anchors {
verticalCenter: lockScreen.verticalCenter
}
z: 200
DeviceLockUI {
id: codePad
visible: DeviceLock.state == DeviceLock.Locked && codepadVisible
width: lockScreen.width
height:lockScreen.height / 2
anchors {
verticalCenter: lockScreen.verticalCenter
}
z: 200
}
}
}
......@@ -57,9 +57,8 @@ Item {
id:margin
height: Theme.itemSpacingSmall
}
TextField {
id:searchField
Row {
id:searchRow
anchors {
top:margin.bottom
left: parent.left
......@@ -69,12 +68,25 @@ Item {
rightMargin: Theme.itemSpacingMedium
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 {
target: gridview
property: "searchString"
value: searchField.text.toLowerCase().trim()
}
}
}
ListView {
......@@ -82,7 +94,7 @@ Item {
clip: true
width: parent.width
height:contentHeight
anchors.top: searchField.bottom
anchors.top: searchRow.bottom
anchors.topMargin: Theme.itemSpacingSmall
visible: searchString.length>0
section.property: 'category'
......@@ -152,7 +164,7 @@ Item {
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 update() {
if(searchString.length<1) {
......
......@@ -31,6 +31,18 @@ MouseArea {
id: switcherItemRoot
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 {
id: windowPixmap
......@@ -38,9 +50,9 @@ MouseArea {
height: rotateWindowContent ? parent.height : parent.width
windowId: model.window
transform: Rotation {
angle: rotateWindowContent ? 0 : 90
origin.x: windowPixmap.height / 2
origin.y: windowPixmap.height / 2
angle:desktopAngle
origin.x: rotateWindowContent ? windowPixmap.width / 2 : angle === 270 ? windowPixmap.width / 2 : windowPixmap.height / 2
origin.y: rotateWindowContent ? windowPixmap.height / 2 : angle === 270 ? windowPixmap.width / 2 : windowPixmap.height / 2
}
smooth: true
radius: 5
......@@ -55,6 +67,8 @@ MouseArea {
onClicked: {
if (!switcherRoot.closeMode) {
Lipstick.compositor.windowToFront(model.window);
} else {
switcherRoot.closeMode = false
}
}
......
......@@ -32,16 +32,126 @@
import QtQuick 2.1
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.Layouts 1.0
import org.nemomobile.dbus 2.0
Component {
CommonPanel {
name: qsTr("Battery");
switcherEnabled: false
ColumnLayout {
anchors.fill: parent
spacing: Theme.itemSpacingSmall
Label {
id:percentageLabel
text: qsTr("Level")+ ": " + batteryChargePercentage.value + "%"
font.pixelSize: Theme.fontSizeSmall
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
Label {
text: qsTr("Level")+ ": " + batteryChargePercentage.value + "%"
font.pixelSize: Theme.fontSizeMedium
anchors.centerIn: parent
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 {
top: commonPanel.top
topMargin: Theme.itemSpacingLarge
}
height: nameLabel.height
width: parent.width
Label{
id: nameLabel
......@@ -115,7 +116,7 @@ Rectangle {
left: parent.left
leftMargin: Theme.itemSpacingLarge
top: actionColumn.bottom
topMargin: Theme.itemSpacingHuge*1.5
topMargin: Theme.itemSpacingMedium
}
}
//Just placeholder until IconButton will get merged
......
......@@ -139,7 +139,7 @@ Component {
visible: !needsPin
text: qsTr("No pin required!")
font.pixelSize:Theme.fontSizeMedium
anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
......@@ -54,6 +54,7 @@ Component {
]
Repeater {
anchors.top: parent.top
model: wifimodel
delegate: Item {
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