mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
slightly larger password font size and add clear function
This commit is contained in:
parent
d797e88aee
commit
eda8fadb12
1 changed files with 26 additions and 14 deletions
|
|
@ -38,6 +38,12 @@ Rectangle {
|
|||
root.password = root.password.substr(0, root.password.length - 1);
|
||||
}
|
||||
|
||||
function clear() {
|
||||
lastKeyPressValue = "0";
|
||||
indexWithNumber = -2;
|
||||
root.password = "";
|
||||
}
|
||||
|
||||
function enter() {
|
||||
authenticator.tryUnlock(root.password);
|
||||
}
|
||||
|
|
@ -100,7 +106,7 @@ Rectangle {
|
|||
|
||||
// pin dot display
|
||||
Item {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.minimumHeight: units.gridUnit * 0.5
|
||||
Layout.maximumWidth: parent.width
|
||||
|
||||
|
|
@ -114,30 +120,31 @@ Rectangle {
|
|||
RowLayout {
|
||||
id: dotDisplay
|
||||
anchors.centerIn: parent
|
||||
height: units.gridUnit // maintain height when letter is shown
|
||||
height: units.gridUnit * 1.5// maintain height when letter is shown
|
||||
spacing: 6
|
||||
|
||||
Repeater {
|
||||
model: root.password.length
|
||||
delegate: Rectangle { // dot
|
||||
visible: index !== indexWithNumber // hide dot if number is shown
|
||||
Layout.preferredWidth: units.gridUnit * 0.25
|
||||
Layout.preferredWidth: units.gridUnit * 0.35
|
||||
Layout.preferredHeight: Layout.preferredWidth
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
radius: width
|
||||
color: "#424242"
|
||||
}
|
||||
}
|
||||
Label { // number/letter
|
||||
visible: root.password.length-1 === indexWithNumber // hide label if no label needed
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: "#424242"
|
||||
text: lastKeyPressValue
|
||||
font.pointSize: 10
|
||||
font.pointSize: 12
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// separator
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -185,6 +192,11 @@ Rectangle {
|
|||
keyPress(modelData);
|
||||
}
|
||||
}
|
||||
onPressAndHold: {
|
||||
if (modelData === "R") {
|
||||
clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue