import QtQuick import QtQuick.Controls.Fusion //import QtQuick.Controls import QtQuick.Layouts ApplicationWindow { id: window width: 640 height: 480 visible: true title: qsTr("xT") property RelayConnection connection ColumnLayout { id: column anchors.fill: parent anchors.margins: 6 ScrollView { id: bufferScroll Layout.fillWidth: true Layout.fillHeight: true TextArea { id: buffer text: qsTr("Buffer text") } } RowLayout { id: row Layout.fillWidth: true Label { Layout.fillWidth: true id: prompt text: qsTr("Prompt") } Label { Layout.fillWidth: true id: status horizontalAlignment: Text.AlignRight text: qsTr("Status") } } TextArea { id: input Layout.fillWidth: true text: qsTr("Input") } } Component.onCompleted: {} Dialog { id: connect title: "Connect to relay" anchors.centerIn: parent modal: true visible: true onRejected: Qt.quit() onAccepted: { // TODO(p): Store the host, store the port, initiate connection. } GridLayout { anchors.fill: parent anchors.margins: 6 columns: 2 // It is a bit silly that one has to do everything manually. Keys.onReturnPressed: connect.accept() Label { text: "Host:" } TextField { id: connectHost Layout.fillWidth: true // And if this doesn't work reliably, do it after open(). focus: true } Label { text: "Port:" } TextField { id: connectPort Layout.fillWidth: true } } footer: DialogButtonBox { Button { text: qsTr("Connect") DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole Keys.onReturnPressed: connect.accept() highlighted: true } Button { text: qsTr("Close") DialogButtonBox.buttonRole: DialogButtonBox.DestructiveRole Keys.onReturnPressed: connect.reject() } } } }