|
@@ -1,5 +1,6 @@
|
|
import QtQuick 2.12
|
|
import QtQuick 2.12
|
|
import QtQuick.Controls 2.5
|
|
import QtQuick.Controls 2.5
|
|
|
|
+import QtQuick.Layouts 1.3
|
|
|
|
|
|
Page {
|
|
Page {
|
|
width: 1280
|
|
width: 1280
|
|
@@ -7,40 +8,59 @@ Page {
|
|
|
|
|
|
font.capitalization: Font.MixedCase
|
|
font.capitalization: Font.MixedCase
|
|
|
|
|
|
- ScrollView {
|
|
|
|
- id: scrollView
|
|
|
|
- x: 0
|
|
|
|
- y: 0
|
|
|
|
- width: 1280
|
|
|
|
- height: 400
|
|
|
|
-
|
|
|
|
- TextArea {
|
|
|
|
- id: messagesLog
|
|
|
|
- width: 1280
|
|
|
|
- height: 400
|
|
|
|
- readOnly: true
|
|
|
|
- text: qsTr("Log goes here\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well\nNew Line works as well")
|
|
|
|
- font.pointSize: 15
|
|
|
|
|
|
+ Connections {
|
|
|
|
+ target: _qmlHandler
|
|
|
|
+ onMessage: {
|
|
|
|
+ messagesLog.append(msg)
|
|
|
|
+ messagesFlickable.contentY = messagesLog.height - messagesFlickable.height
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- TextField {
|
|
|
|
- id: messageInput
|
|
|
|
- x: 20
|
|
|
|
- y: 400
|
|
|
|
- width: 1060
|
|
|
|
- height: 70
|
|
|
|
- placeholderText: "Enter message..."
|
|
|
|
- text: qsTr("")
|
|
|
|
- font.pixelSize: 20
|
|
|
|
- }
|
|
|
|
|
|
+ ColumnLayout {
|
|
|
|
+ anchors.fill: parent
|
|
|
|
+
|
|
|
|
+ Flickable {
|
|
|
|
+ id: messagesFlickable
|
|
|
|
+ flickableDirection: Flickable.VerticalFlick
|
|
|
|
+ Layout.preferredHeight: 400
|
|
|
|
+ Layout.preferredWidth: parent.width
|
|
|
|
+
|
|
|
|
+ TextArea.flickable: TextArea {
|
|
|
|
+ id: messagesLog
|
|
|
|
+ wrapMode: TextArea.Wrap
|
|
|
|
+ text: qsTr("Messages go here\nNew Line works as well")
|
|
|
|
+ font.pointSize: 15
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ScrollBar.vertical: ScrollBar {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- Button {
|
|
|
|
- id: sendButton
|
|
|
|
- x: 1100
|
|
|
|
- y: 400
|
|
|
|
- width: 180
|
|
|
|
- height: 70
|
|
|
|
- text: qsTr("Send")
|
|
|
|
|
|
+ RowLayout {
|
|
|
|
+ Layout.preferredHeight: 70
|
|
|
|
+ Layout.preferredWidth: parent.width
|
|
|
|
+
|
|
|
|
+ TextField {
|
|
|
|
+ id: messagesInputField
|
|
|
|
+ Layout.preferredWidth: 1060
|
|
|
|
+ Layout.preferredHeight: parent.height
|
|
|
|
+ placeholderText: "Enter message..."
|
|
|
|
+ text: qsTr("")
|
|
|
|
+ font.pixelSize: 20
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Button {
|
|
|
|
+ id: messagesSendButton
|
|
|
|
+ Layout.preferredWidth: 180
|
|
|
|
+ Layout.preferredHeight: parent.height
|
|
|
|
+ text: qsTr("Send")
|
|
|
|
+
|
|
|
|
+ // @disable-check M223
|
|
|
|
+ onClicked: {
|
|
|
|
+ // @disable-check M222
|
|
|
|
+ _qmlHandler.onMessagesSendButton(messagesInputField.text)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|