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:
parent
94b0343d04
commit
b778fa9c30
|
@ -31,14 +31,6 @@ Item {
|
||||||
root.setWidths()
|
root.setWidths()
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
|
||||||
enabled: !appSettings.compactMode
|
|
||||||
target: appSettings.compactMode ? null : chatBox
|
|
||||||
onLongChatTextChanged: {
|
|
||||||
root.setWidths()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledTextEdit {
|
StyledTextEdit {
|
||||||
id: chatText
|
id: chatText
|
||||||
visible: !root.veryLongChatText || root.readMore
|
visible: !root.veryLongChatText || root.readMore
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import QtQuick 2.3
|
import QtQuick 2.13
|
||||||
import "../../../../../shared"
|
import "../../../../../shared"
|
||||||
import "../../../../../imports"
|
import "../../../../../imports"
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ Item {
|
||||||
anchors.top: chatReply.bottom
|
anchors.top: chatReply.bottom
|
||||||
z: 51
|
z: 51
|
||||||
|
|
||||||
|
|
||||||
sourceComponent: Component {
|
sourceComponent: Component {
|
||||||
ChatImage {
|
ChatImage {
|
||||||
imageSource: image
|
imageSource: image
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import QtQuick 2.3
|
import QtQuick 2.13
|
||||||
import "../../../../../shared"
|
import "../../../../../shared"
|
||||||
import "../../../../../imports"
|
import "../../../../../imports"
|
||||||
|
|
||||||
|
@ -126,6 +126,13 @@ Item {
|
||||||
anchors.right: chatBox.longChatText ? parent.right : undefined
|
anchors.right: chatBox.longChatText ? parent.right : undefined
|
||||||
anchors.rightMargin: chatBox.longChatText ? chatBox.chatHorizontalPadding : 0
|
anchors.rightMargin: chatBox.longChatText ? chatBox.chatHorizontalPadding : 0
|
||||||
textField.color: !isCurrentUser ? Style.current.textColor : Style.current.currentUserTextColor
|
textField.color: !isCurrentUser ? Style.current.textColor : Style.current.currentUserTextColor
|
||||||
|
Connections {
|
||||||
|
enabled: !appSettings.compactMode
|
||||||
|
target: appSettings.compactMode ? null : chatBox
|
||||||
|
onLongChatTextChanged: {
|
||||||
|
chatText.setWidths()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|
Loading…
Reference in New Issue