浏览代码

US11: Final GUI Layout with some fixes + improvements

Cyamond 5 年之前
父节点
当前提交
dea56246ed
共有 5 个文件被更改,包括 15 次插入2 次删除
  1. 1 0
      gui/src/FooterForm.ui.qml
  2. 1 0
      gui/src/IpPopupForm.ui.qml
  3. 8 1
      gui/src/MessagesForm.ui.qml
  4. 1 0
      gui/src/SwitchIpPopupForm.ui.qml
  5. 4 1
      gui/src/main.qml

+ 1 - 0
gui/src/FooterForm.ui.qml

@@ -38,6 +38,7 @@ Page {
                 Layout.preferredWidth: parent.width
 
                 TextArea.flickable: TextArea {
+                    selectByMouse: true
                     id: footerLog
                     wrapMode: TextArea.Wrap
                     text: qsTr("Log goes here\nNew Line works as well")

+ 1 - 0
gui/src/IpPopupForm.ui.qml

@@ -28,6 +28,7 @@ Popup {
         TextField {
             Layout.alignment: Qt.AlignCenter
             id: popupIpInput
+            selectByMouse: true
             text: qsTr("")
             placeholderText: "Enter IP"
             horizontalAlignment: Text.AlignHCenter

+ 8 - 1
gui/src/MessagesForm.ui.qml

@@ -27,6 +27,7 @@ Page {
 
             TextArea.flickable: TextArea {
                 id: messagesLog
+                selectByMouse: true
                 wrapMode: TextArea.Wrap
                 text: qsTr("Messages go here\nNew Line works as well")
                 font.pointSize: 15
@@ -42,11 +43,14 @@ Page {
 
             TextField {
                 id: messagesInputField
+                selectByMouse: true
                 Layout.preferredWidth: 1060
                 Layout.preferredHeight: parent.height
                 placeholderText: "Enter message..."
                 text: qsTr("")
                 font.pixelSize: 20
+                Keys.onReturnPressed: messagesSendButton.activate()
+                Keys.onEnterPressed: messagesSendButton.activate()
             }
 
             Button {
@@ -58,8 +62,11 @@ Page {
                 // @disable-check M223
                 onClicked: {
                     // @disable-check M222
-                    _qmlHandler.onMessagesSendButton(messagesInputField.text)
+                    messagesSendButton.activate()
                 }
+
+                enabled: messagesInputField.text != ""
+                function activate() {if(messagesInputField.text != "") {_qmlHandler.onMessagesSendButton(messagesInputField.text); messagesInputField.text = ""}}
             }
         }
     }

+ 1 - 0
gui/src/SwitchIpPopupForm.ui.qml

@@ -28,6 +28,7 @@ Popup {
         TextField {
             Layout.alignment: Qt.AlignCenter
             id: switchIpInput
+            selectByMouse: true
             text: qsTr("")
             placeholderText: "Enter IP"
             horizontalAlignment: Text.AlignHCenter

+ 4 - 1
gui/src/main.qml

@@ -83,5 +83,8 @@ ApplicationWindow {
         y: Math.round((parent.height - height) / 2)
     }
 
-    Component.onCompleted: ipDialog.open()
+    Component.onCompleted: {
+      swipeView.interactive = false
+      ipDialog.open()
+    }
 }