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,26 +115,31 @@ 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)
|
||||
|
||||
|
||||
TextArea
|
||||
{
|
||||
property var styles: StyleChat.inferiorPanel.msgComposer
|
||||
id: msgField
|
||||
|
||||
height:
|
||||
(contentHeight > font.pixelSize)?
|
||||
contentHeight +font.pixelSize : parent.styles.height
|
||||
|
||||
width: parent.width
|
||||
|
||||
Layout.maximumHeight: chatView.height / styles.maxHeight
|
||||
|
||||
placeholderText: styles.placeHolder
|
||||
background: styles.background
|
||||
|
||||
@ -151,23 +156,12 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
BtnIcon {
|
||||
|
||||
id: emojiButton
|
||||
|
Loading…
Reference in New Issue
Block a user