chore: fix spacing and width of chat identifier

This commit is contained in:
Jonathan Rainville 2021-04-28 13:33:10 -04:00 committed by Iuri Matias
parent 49d130a111
commit 9d625016ff
1 changed files with 18 additions and 35 deletions

View File

@ -4,7 +4,6 @@ import "../../../../../imports"
Column { Column {
property string authorCurrentMsg: "authorCurrentMsg" property string authorCurrentMsg: "authorCurrentMsg"
property int verticalMargin: 50
property string profileImage property string profileImage
@ -13,7 +12,7 @@ Column {
visible: authorCurrentMsg === "" visible: authorCurrentMsg === ""
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: this.visible ? verticalMargin : 0 anchors.topMargin: this.visible ? Style.current.bigPadding : 0
Rectangle { Rectangle {
id: circleId id: circleId
@ -76,39 +75,31 @@ Column {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
Item { StyledText {
id: channelDescription id: descText
visible: descText.visible wrapMode: Text.Wrap
width: visible ? 330 : 0
height: visible ? childrenRect.height : 0
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: 310
StyledText { text: {
id: descText switch(chatsModel.activeChannel.chatType) {
wrapMode: Text.Wrap //% "Welcome to the beginning of the <span style='color: %1'>%2</span> group!"
text: { case Constants.chatTypePrivateGroupChat: return qsTrId("welcome-to-the-beginning-of-the--span-style--color---1---2--span--group-").arg(Style.current.textColor).arg(chatsModel.activeChannel.name);
switch(chatsModel.activeChannel.chatType) { //% "Any messages you send here are encrypted and can only be read by you and <span style='color: %1'>%2</span>"
//% "Welcome to the beginning of the <span style='color: %1'>%2</span> group!" case Constants.chatTypeOneToOne: return qsTrId("any-messages-you-send-here-are-encrypted-and-can-only-be-read-by-you-and--span-style--color---1---2--span-").arg(Style.current.textColor).arg(channelName.text)
case Constants.chatTypePrivateGroupChat: return qsTrId("welcome-to-the-beginning-of-the--span-style--color---1---2--span--group-").arg(Style.current.textColor).arg(chatsModel.activeChannel.name); default: return "";
//% "Any messages you send here are encrypted and can only be read by you and <span style='color: %1'>%2</span>"
case Constants.chatTypeOneToOne: return qsTrId("any-messages-you-send-here-are-encrypted-and-can-only-be-read-by-you-and--span-style--color---1---2--span-").arg(Style.current.textColor).arg(channelName.text)
default: return "";
}
} }
font.pixelSize: 14
color: Style.current.secondaryText
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
textFormat: Text.RichText
} }
font.pixelSize: Style.current.primaryTextFontSize
color: Style.current.secondaryText
horizontalAlignment: Text.AlignHCenter
textFormat: Text.RichText
} }
Item { Item {
visible: chatsModel.activeChannel.chatType === Constants.chatTypePrivateGroupChat && !chatsModel.activeChannel.isMember visible: chatsModel.activeChannel.chatType === Constants.chatTypePrivateGroupChat && !chatsModel.activeChannel.isMember
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: joinChat.width width: visible ? joinChat.width : 0
height: visible ? 100 : 10 height: visible ? 100 : 0
id: joinOrDecline id: joinOrDecline
StyledText { StyledText {
@ -146,14 +137,6 @@ Column {
} }
} }
} }
Item {
id: spacer
visible: chatsModel.activeChannel.chatType === Constants.chatTypePrivateGroupChat && chatsModel.activeChannel.isMember
width: parent.width
height: Style.current.bigPadding
}
} }
/*##^## /*##^##