Commit 5126dce6 authored by m2ko's avatar m2ko

Scaling and orientation fix to codepad

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