Merge pull request #20 from mihawk90/focus-input-fields
added (configurable) auto-focus of input fields
This commit is contained in:
20
Main.qml
20
Main.qml
@@ -67,7 +67,15 @@ Rectangle {
|
|||||||
id: mouseArea1
|
id: mouseArea1
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
//onPressed: {playlist1.shuffle(); playlist1.next();}
|
//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: {
|
Keys.onPressed: {
|
||||||
fader1.state = "on";
|
fader1.state = "on";
|
||||||
@@ -106,7 +114,15 @@ Rectangle {
|
|||||||
id: mouseArea2
|
id: mouseArea2
|
||||||
enabled: false
|
enabled: false
|
||||||
anchors.fill: parent;
|
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 {
|
Behavior on opacity {
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
@@ -9,3 +9,4 @@ usernameLeftMargin=15
|
|||||||
relativePositionX=0.3
|
relativePositionX=0.3
|
||||||
relativePositionY=0.7
|
relativePositionY=0.7
|
||||||
showTopBar=true
|
showTopBar=true
|
||||||
|
autofocusInput=true
|
||||||
|
|||||||
@@ -9,3 +9,4 @@ showLoginButton=false
|
|||||||
type=color
|
type=color
|
||||||
usernameLeftMargin=15
|
usernameLeftMargin=15
|
||||||
showTopBar=true
|
showTopBar=true
|
||||||
|
autofocusInput=true
|
||||||
|
|||||||
Reference in New Issue
Block a user