refactor(ChatText): move Connection out of component

This is done because there's gonna be a case where this connection causes errors
because the component expects `NormalMessage` to be a parent of this component.

When used in future StatusUpdates, there's no `NormalMessage`. Unfortunately,
disabling the connection based on a condition doesn't remove the error, so we have
to move this code out entirely
This commit is contained in:
Pascal Precht 2020-12-04 11:38:22 +01:00 committed by Pascal Precht
parent 94b0343d04
commit b778fa9c30
3 changed files with 9 additions and 11 deletions

View File

@ -31,14 +31,6 @@ Item {
root.setWidths()
}
Connections {
enabled: !appSettings.compactMode
target: appSettings.compactMode ? null : chatBox
onLongChatTextChanged: {
root.setWidths()
}
}
StyledTextEdit {
id: chatText
visible: !root.veryLongChatText || root.readMore

View File

@ -1,4 +1,4 @@
import QtQuick 2.3
import QtQuick 2.13
import "../../../../../shared"
import "../../../../../imports"
@ -64,7 +64,6 @@ Item {
anchors.top: chatReply.bottom
z: 51
sourceComponent: Component {
ChatImage {
imageSource: image

View File

@ -1,4 +1,4 @@
import QtQuick 2.3
import QtQuick 2.13
import "../../../../../shared"
import "../../../../../imports"
@ -126,6 +126,13 @@ Item {
anchors.right: chatBox.longChatText ? parent.right : undefined
anchors.rightMargin: chatBox.longChatText ? chatBox.chatHorizontalPadding : 0
textField.color: !isCurrentUser ? Style.current.textColor : Style.current.currentUserTextColor
Connections {
enabled: !appSettings.compactMode
target: appSettings.compactMode ? null : chatBox
onLongChatTextChanged: {
chatText.setWidths()
}
}
}
Loader {