Chat Information Page: More tweaks
This commit is contained in:
parent
5ee71dda29
commit
179ef885b5
4 changed files with 11 additions and 10 deletions
|
@ -12,13 +12,14 @@ PhotoTextsListItem {
|
||||||
// replacementStringHint: primaryText.text
|
// replacementStringHint: primaryText.text
|
||||||
}
|
}
|
||||||
property int ownUserId
|
property int ownUserId
|
||||||
|
property url emojiBase: "../js/emoji/"
|
||||||
|
|
||||||
// chat title
|
// chat title
|
||||||
primaryText.text: title ? Emoji.emojify(title, Theme.fontSizeMedium) + ( display.notification_settings.mute_for > 0 ? Emoji.emojify(" 🔇", Theme.fontSizeMedium) : "" ) : qsTr("Unknown")
|
primaryText.text: title ? Emoji.emojify(title, Theme.fontSizeMedium, emojiBase) + ( display.notification_settings.mute_for > 0 ? Emoji.emojify(" 🔇", Theme.fontSizeMedium) : "" ) : qsTr("Unknown")
|
||||||
// last user
|
// last user
|
||||||
prologSecondaryText.text: is_channel ? "" : ( last_message_sender_id ? ( last_message_sender_id !== ownUserId ? Emoji.emojify(Functions.getUserName(tdLibWrapper.getUserInformation(last_message_sender_id)), primaryText.font.pixelSize) : qsTr("You") ) : qsTr("Unknown") )
|
prologSecondaryText.text: is_channel ? "" : ( last_message_sender_id ? ( last_message_sender_id !== ownUserId ? Emoji.emojify(Functions.getUserName(tdLibWrapper.getUserInformation(last_message_sender_id)), primaryText.font.pixelSize) : qsTr("You") ) : qsTr("Unknown") )
|
||||||
// last message
|
// last message
|
||||||
secondaryText.text: last_message_text ? Emoji.emojify(last_message_text, Theme.fontSizeExtraSmall) : qsTr("Unknown")
|
secondaryText.text: last_message_text ? Emoji.emojify(last_message_text, Theme.fontSizeExtraSmall, emojiBase) : qsTr("Unknown")
|
||||||
// message date
|
// message date
|
||||||
tertiaryText.text: last_message_date ? Functions.getDateTimeElapsed(last_message_date) : qsTr("Unknown")
|
tertiaryText.text: last_message_date ? Functions.getDateTimeElapsed(last_message_date) : qsTr("Unknown")
|
||||||
unreadCount: unread_count
|
unreadCount: unread_count
|
||||||
|
|
|
@ -39,7 +39,6 @@ Column {
|
||||||
|
|
||||||
SectionHeader {
|
SectionHeader {
|
||||||
id: editAreaHeader
|
id: editAreaHeader
|
||||||
font.pixelSize: Theme.fontSizeExtraSmall
|
|
||||||
height: parent.visible && text !== "" ? Theme.itemSizeExtraSmall : 0
|
height: parent.visible && text !== "" ? Theme.itemSizeExtraSmall : 0
|
||||||
x: 0
|
x: 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,18 +79,18 @@ ChatInformationTabItemBase {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
// chat title isPrivateChat ? () :
|
// chat title isPrivateChat ? () :
|
||||||
primaryText.text: Emoji.emojify(Functions.getUserName(user), primaryText.font.pixelSize, "../../js/emoji/")
|
primaryText.text: Emoji.emojify(Functions.getUserName(user), primaryText.font.pixelSize, "../js/emoji/")
|
||||||
// last user
|
// last user
|
||||||
prologSecondaryText.text: "@"+(user.username !== "" ? user.username : user_id) + (user_id === chatInformationPage.myUserId ? " " + qsTr("You") : "")
|
prologSecondaryText.text: "@"+(user.username !== "" ? user.username : user_id) + (user_id === chatInformationPage.myUserId ? " " + qsTr("You") : "")
|
||||||
secondaryText {
|
secondaryText {
|
||||||
horizontalAlignment: Text.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
property string statusText: Functions.getChatMemberStatusText(model.status["@type"])
|
property string statusText: Functions.getChatMemberStatusText(model.status["@type"])
|
||||||
property string customText: model.status.custom_title ? Emoji.emojify(model.status.custom_title, secondaryText.font.pixelSize, "../../js/emoji/") : ""
|
property string customText: model.status.custom_title ? Emoji.emojify(model.status.custom_title, secondaryText.font.pixelSize, "../js/emoji/") : ""
|
||||||
text: (statusText !== "" && customText !== "") ? statusText + ", " + customText : statusText + customText
|
text: (statusText !== "" && customText !== "") ? statusText + ", " + customText : statusText + customText
|
||||||
}
|
}
|
||||||
tertiaryText {
|
tertiaryText {
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
text: user.type["@type"] === "userTypeBot" ? (Emoji.emojify("🤖 "+bot_info.description, tertiaryText.font.pixelSize, "../../js/emoji/")) : Functions.getChatPartnerStatusText(user.status["@type"], user.status.was_online);
|
text: user.type["@type"] === "userTypeBot" ? (Emoji.emojify("🤖 "+bot_info.description, tertiaryText.font.pixelSize, "../js/emoji/")) : Functions.getChatPartnerStatusText(user.status["@type"], user.status.was_online);
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,11 @@ Column {
|
||||||
id: labelComponent
|
id: labelComponent
|
||||||
Label {
|
Label {
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
font.pixelSize: Theme.fontSizeExtraSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
color: Theme.highlightColor
|
color: Theme.primaryColor
|
||||||
text: Emoji.emojify( Functions.replaceUrlsWithLinks(textItem.text).replace(/\n/g, "<br>"), Theme.fontSizeExtraSmall, "../../js/emoji/")
|
text: Emoji.emojify( Functions.replaceUrlsWithLinks(textItem.text).replace(/\n/g, "<br>"), Theme.fontSizeExtraSmall, "../../js/emoji/")
|
||||||
linkColor: Theme.primaryColor
|
linkColor: Theme.highlightColor
|
||||||
visible: text !== ""
|
visible: text !== ""
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
Functions.handleLink(link);
|
Functions.handleLink(link);
|
||||||
|
@ -62,8 +62,9 @@ Column {
|
||||||
id: linkedLabelComponent
|
id: linkedLabelComponent
|
||||||
LinkedLabel {
|
LinkedLabel {
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
font.pixelSize: Theme.fontSizeExtraSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
|
color: Theme.highlightColor
|
||||||
plainText: textItem.text
|
plainText: textItem.text
|
||||||
visible: textItem.text !== ""
|
visible: textItem.text !== ""
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
|
|
Loading…
Reference in a new issue