feat: hide arrow input when text is empty + use good arrow icon

This commit is contained in:
Jonathan Rainville 2020-05-28 15:41:31 -04:00 committed by Iuri Matias
parent 4fa3c34199
commit 9bd54881ce
2 changed files with 18 additions and 5 deletions

View File

@ -22,12 +22,11 @@ Rectangle {
Button {
id: chatSendBtn
visible: txtData.length > 0
x: 100
width: 30
height: 30
text: "\u2191"
font.bold: true
font.pointSize: 12
text: ""
anchors.top: parent.top
anchors.topMargin: 20
anchors.right: parent.right
@ -36,11 +35,17 @@ Rectangle {
chatsModel.onSend(txtData.text)
txtData.text = ""
}
enabled: txtData.text !== ""
background: Rectangle {
color: parent.enabled ? Theme.blue : Theme.grey
radius: 50
}
Image {
source: "../../../img/arrowUp.svg"
width: 12
fillMode: Image.PreserveAspectFit
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
TextField {
@ -78,4 +83,9 @@ Rectangle {
}
}
}
}
}
/*##^##
Designer {
D{i:0;width:600}
}
##^##*/

3
ui/app/img/arrowUp.svg Normal file
View File

@ -0,0 +1,3 @@
<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.95235 3.34577L8.37242 5.83333C8.73926 6.2104 9.34668 6.21409 9.71911 5.83127C10.0941 5.44578 10.0924 4.8287 9.72112 4.44702L5.67102 0.283973C5.48793 0.0957746 5.2449 0.000588088 5.00108 4.48202e-05C4.75404 -0.00238444 4.51166 0.093471 4.32633 0.283973L0.276227 4.44702C-0.0906155 4.82409 -0.0942032 5.44845 0.278229 5.83127C0.653258 6.21676 1.2536 6.21501 1.62492 5.83333L4.045 3.34577L4.045 11.0242C4.045 11.5533 4.47197 12 4.99867 12C5.52904 12 5.95234 11.5631 5.95234 11.0242L5.95235 3.34577Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 667 B