Commit ff6a649f authored by Andrea Scarpino's avatar Andrea Scarpino

Do not enable the search button if there's no text

parent 01ab0890
......@@ -107,6 +107,8 @@ Page {
focus: true
placeholderText: qsTr("Artist")
onTextChanged: search.enabled = (text.length > 0 && song.text.length > 0)
EnterKey.enabled: text.length > 0 && song.text.length > 0
EnterKey.onClicked: searchLyric();
}
......@@ -116,6 +118,8 @@ Page {
width: parent.width
placeholderText: qsTr("Song")
onTextChanged: search.enabled = (text.length > 0 && artist.text.length > 0)
EnterKey.enabled: text.length > 0 && artist.text.length > 0
EnterKey.onClicked: searchLyric();
}
......@@ -130,12 +134,9 @@ Page {
id: search
text: qsTr("Search")
anchors.horizontalCenter: parent.horizontalCenter
enabled: false
onClicked: {
if (artist.text.length > 0 && song.text.length > 0) {
searchLyric();
}
}
onClicked: searchLyric()
}
Text {
......
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