Commit 5126dce6 authored by m2ko's avatar m2ko

Scaling and orientation fix to codepad

parent 7b20b950
...@@ -51,34 +51,45 @@ Item { ...@@ -51,34 +51,45 @@ Item {
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 40 spacing: Theme.itemSpacingLarge
TextField { TextField {
id: lockCodeField id: lockCodeField
anchors.horizontalCenter: parent.horizontalCenter
readOnly: true readOnly: true
echoMode: TextInput.PasswordEchoOnEdit echoMode: TextInput.PasswordEchoOnEdit
anchors.horizontalCenter: parent.horizontalCenter
} }
GridLayout { GridLayout {
height: parent.height height: parent.height
width: parent.width width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
columns: 3 columns: 3
Repeater { Repeater {
model: ["1","2","3","4","5","6","7","8","9","Ca","0","OK"] model: ["1","2","3","4","5","6","7","8","9","Ca","0","OK"]
delegate: delegate:
Button { Button {
style: ButtonStyle {} height: Theme.itemHeightHuge
Layout.fillWidth: true width: Theme.itemHeightHuge
Layout.maximumWidth: Theme.itemHeightHuge * 1.5
Layout.maximumHeight: Theme.itemHeightHuge * 1.5
Label {
id: btnLabel
text: modelData text: modelData
font.pixelSize: Theme.fontSizeExtraLarge * 1.5
anchors {
centerIn: parent
}
}
onClicked: { onClicked: {
if (text !== "Ca" && text !== "OK") { if (btnLabel.text !== "Ca" && btnLabel.text !== "OK") {
lockCodeField.insert(lockCodeField.cursorPosition, text) lockCodeField.insert(lockCodeField.cursorPosition, btnLabel.text)
} else { } else {
if (text === "OK") { if (btnLabel.text === "OK") {
authenticator.enterLockCode(lockCodeField.text) authenticator.enterLockCode(lockCodeField.text)
lockCodeField.text = "" lockCodeField.text = ""
} else if (text === "Ca"){ } else if (btnLabel.text === "Ca"){
lockCodeField.text = "" lockCodeField.text = ""
} }
} }
......
...@@ -75,6 +75,7 @@ Page { ...@@ -75,6 +75,7 @@ Page {
Statusbar { Statusbar {
id: statusbar id: statusbar
enabled: DeviceLock.state !== DeviceLock.Locked
} }
GlacierRotation { GlacierRotation {
...@@ -83,7 +84,7 @@ Page { ...@@ -83,7 +84,7 @@ Page {
unrotatedItems: [lockScreen] unrotatedItems: [lockScreen]
} }
orientation: Lipstick.compositor.screenOrientation orientation: DeviceLock.state == DeviceLock.Locked ? nativeOrientation : Lipstick.compositor.screenOrientation
onOrientationChanged: { onOrientationChanged: {
if (!lockscreenVisible()) if (!lockscreenVisible())
......
...@@ -259,7 +259,7 @@ Compositor { ...@@ -259,7 +259,7 @@ Compositor {
PropertyChanges { PropertyChanges {
target: Desktop.instance.codepad target: Desktop.instance.codepad
// Extremely confusing logic and math to get the codepad follow your finger // Confusing logic and math to get the codepad follow your finger
x: gestureArea.lockscreenX + (gestureArea.value < 0 ? Desktop.instance.lockscreen.width : -Desktop.instance.lockscreen.width) + x: gestureArea.lockscreenX + (gestureArea.value < 0 ? Desktop.instance.lockscreen.width : -Desktop.instance.lockscreen.width) +
((gestureArea.horizontal) ? (Desktop.instance.lockscreenVisible()?(gestureArea.value) : ((gestureArea.horizontal) ? (Desktop.instance.lockscreenVisible()?(gestureArea.value) :
(gestureArea.gesture == "right" ? (gestureArea.gesture == "right" ?
......
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