mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 14:40:56 +00:00
Improve Add PC dialog to have a proper text field
This commit is contained in:
+12
-14
@@ -248,32 +248,30 @@ GridView {
|
|||||||
Dialog {
|
Dialog {
|
||||||
id: addPcDialog
|
id: addPcDialog
|
||||||
property string label: "Enter the IP address of your GameStream PC"
|
property string label: "Enter the IP address of your GameStream PC"
|
||||||
property string hint: "192.168.1.100"
|
|
||||||
property alias editText : editTextItem
|
|
||||||
|
|
||||||
standardButtons: StandardButton.Ok | StandardButton.Cancel
|
standardButtons: StandardButton.Ok | StandardButton.Cancel
|
||||||
onVisibleChanged: {
|
|
||||||
editTextItem.focus = true
|
|
||||||
editTextItem.selectAll()
|
|
||||||
}
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
if (editText.text) {
|
||||||
ComputerManager.addNewHost(editText.text, false)
|
ComputerManager.addNewHost(editText.text, false)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible) {
|
||||||
|
editText.forceActiveFocus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Text {
|
Text {
|
||||||
id: addPcDialogLabel
|
id: addPcDialogLabel
|
||||||
text: addPcDialog.label
|
text: addPcDialog.label
|
||||||
}
|
}
|
||||||
Rectangle {
|
|
||||||
implicitWidth: parent.parent.width
|
|
||||||
height: editTextItem.height
|
|
||||||
|
|
||||||
TextInput {
|
TextField {
|
||||||
id: editTextItem
|
id: editText
|
||||||
inputMethodHints: Qt.ImhPreferUppercase
|
Layout.fillWidth: true
|
||||||
text: addPcDialog.hint
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user