mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Set msg field max width using row layout
This commit is contained in:
parent
ee0b347200
commit
e2d430a82a
@ -115,59 +115,53 @@ Item
|
||||
}
|
||||
|
||||
|
||||
TextArea
|
||||
{
|
||||
property var styles: StyleChat.inferiorPanel.msgComposer
|
||||
RowLayout {
|
||||
id: msgComposer
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: attachButton.right
|
||||
|
||||
height: setTextAreaHeight()
|
||||
|
||||
////
|
||||
//// (contentHeight > font.pixelSize)? contentHeight +font.pixelSize : parent.styles.height
|
||||
|
||||
|
||||
width: chatView.width -
|
||||
(sendButton.width + sendButton.anchors.margins) -
|
||||
(attachButton.width + attachButton.anchors.margins) -
|
||||
(emojiButton.width + emojiButton.anchors.margins)
|
||||
|
||||
|
||||
placeholderText: styles.placeHolder
|
||||
background: styles.background
|
||||
TextArea
|
||||
{
|
||||
property var styles: StyleChat.inferiorPanel.msgComposer
|
||||
id: msgField
|
||||
|
||||
wrapMode: TextEdit.Wrap
|
||||
height:
|
||||
(contentHeight > font.pixelSize)?
|
||||
contentHeight +font.pixelSize : parent.styles.height
|
||||
|
||||
onTextChanged: {
|
||||
if (msgComposer.length == 0)
|
||||
{
|
||||
sendButton.state = ""
|
||||
}
|
||||
else if (msgComposer.length > 0)
|
||||
{
|
||||
sendButton.state = "SENDBTN"
|
||||
}
|
||||
}
|
||||
width: parent.width
|
||||
|
||||
function setTextAreaHeight (){
|
||||
if (msgComposer.height >= chatView.height / msgComposer.styles.maxHeight)
|
||||
{
|
||||
return msgComposer.height
|
||||
}
|
||||
else if (contentHeight > font.pixelSize)
|
||||
{
|
||||
return msgComposer.contentHeight + msgComposer.font.pixelSize
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent.styles.height
|
||||
Layout.maximumHeight: chatView.height / styles.maxHeight
|
||||
|
||||
placeholderText: styles.placeHolder
|
||||
background: styles.background
|
||||
|
||||
wrapMode: TextEdit.Wrap
|
||||
|
||||
onTextChanged: {
|
||||
if (msgComposer.length == 0)
|
||||
{
|
||||
sendButton.state = ""
|
||||
}
|
||||
else if (msgComposer.length > 0)
|
||||
{
|
||||
sendButton.state = "SENDBTN"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
BtnIcon {
|
||||
|
||||
id: emojiButton
|
||||
|
Loading…
Reference in New Issue
Block a user