added (configurable) auto-focus of input fields; see also 3ximus/aerial-sddm-theme#13

This commit is contained in:
Tarulia 2019-09-18 23:09:10 +02:00
parent c1ea4d7bd0
commit 889886a70b
3 changed files with 20 additions and 2 deletions

View File

@ -67,7 +67,15 @@ Rectangle {
id: mouseArea1
anchors.fill: parent;
//onPressed: {playlist1.shuffle(); playlist1.next();}
onPressed: { fader1.state = fader1.state == "off" ? "on" : "off" ; }
onPressed: {
fader1.state = fader1.state == "off" ? "on" : "off" ;
if (config.autofocusInput == "true") {
if (username_input_box.text == "")
username_input_box.focus = true
else
password_input_box.focus = true
}
}
}
Keys.onPressed: {
fader1.state = "on";
@ -106,7 +114,15 @@ Rectangle {
id: mouseArea2
enabled: false
anchors.fill: parent;
onPressed: { fader2.state = fader2.state == "off" ? "on" : "off" ; }
onPressed: {
fader1.state = fader1.state == "off" ? "on" : "off" ;
if (config.autofocusInput == "true") {
if (username_input_box.text == "")
username_input_box.focus = true
else
password_input_box.focus = true
}
}
}
Behavior on opacity {
enabled: true

View File

@ -9,3 +9,4 @@ usernameLeftMargin=15
relativePositionX=0.3
relativePositionY=0.7
showTopBar=true
autofocusInput=true

View File

@ -9,3 +9,4 @@ showLoginButton=false
type=color
usernameLeftMargin=15
showTopBar=true
autofocusInput=true