From 07b8d35fb34d09021f9b920873d665130c9f2d63 Mon Sep 17 00:00:00 2001 From: John Gibbon Date: Sat, 21 Nov 2020 23:56:03 +0100 Subject: [PATCH] Remove obsolete emoji basePath workaround --- qml/components/ChatListViewItem.qml | 5 ++--- qml/components/PollPreview.qml | 4 +--- .../chatInformationPage/ChatInformationPageContent.qml | 4 +--- .../ChatInformationTabItemMembersGroups.qml | 8 ++++---- .../chatInformationPage/ChatInformationTextItem.qml | 2 +- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/qml/components/ChatListViewItem.qml b/qml/components/ChatListViewItem.qml index c6b8a6f..47bf5fc 100644 --- a/qml/components/ChatListViewItem.qml +++ b/qml/components/ChatListViewItem.qml @@ -10,14 +10,13 @@ PhotoTextsListItem { photoData: photo_small || ({}) } property int ownUserId - property url emojiBase: "../js/emoji/" // chat title - primaryText.text: title ? Emoji.emojify(title + ( display.notification_settings.mute_for > 0 ? " 🔇" : "" ), Theme.fontSizeMedium, emojiBase) : qsTr("Unknown") + primaryText.text: title ? Emoji.emojify(title + ( display.notification_settings.mute_for > 0 ? " 🔇" : "" ), Theme.fontSizeMedium) : qsTr("Unknown") // 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") ) // last message - secondaryText.text: last_message_text ? Emoji.emojify(Functions.enhanceHtmlEntities(last_message_text), Theme.fontSizeExtraSmall, emojiBase) : qsTr("Unknown") + secondaryText.text: last_message_text ? Emoji.emojify(Functions.enhanceHtmlEntities(last_message_text), Theme.fontSizeExtraSmall) : qsTr("Unknown") // message date tertiaryText.text: ( last_message_date ? Functions.getDateTimeElapsed(last_message_date) : qsTr("Unknown") ) + Emoji.emojify(last_message_status, tertiaryText.font.pixelSize) unreadCount: unread_count diff --git a/qml/components/PollPreview.qml b/qml/components/PollPreview.qml index 79d5689..4157936 100644 --- a/qml/components/PollPreview.qml +++ b/qml/components/PollPreview.qml @@ -106,11 +106,9 @@ Item { id: canAnswerDelegate TextSwitch { id: optionDelegate - // TextSwitch changes the html base path: - property url emojiBase: "../js/emoji/" width: pollMessageComponent.width automaticCheck: false - text: Emoji.emojify(modelData.text, Theme.fontSizeMedium, emojiBase) + text: Emoji.emojify(modelData.text, Theme.fontSizeMedium) checked: pollMessageComponent.chosenIndexes.indexOf(index) > -1 onClicked: { pollMessageComponent.handleChoose(index); diff --git a/qml/components/chatInformationPage/ChatInformationPageContent.qml b/qml/components/chatInformationPage/ChatInformationPageContent.qml index a7778ab..40341ad 100644 --- a/qml/components/chatInformationPage/ChatInformationPageContent.qml +++ b/qml/components/chatInformationPage/ChatInformationPageContent.qml @@ -285,10 +285,8 @@ SilicaFlickable { : "../components/chatInformationPage/ChatInformationProfilePicture.qml" } } - // PageHeader changes the html base path: - property url emojiBase: "../js/emoji/" leftMargin: imageContainer.getEased((imageContainer.minDimension + Theme.paddingMedium), 0, imageContainer.tweenFactor) + Theme.horizontalPageMargin - title: chatInformationPage.chatInformation.title !== "" ? Emoji.emojify(chatInformationPage.chatInformation.title, Theme.fontSizeLarge, emojiBase) : qsTr("Unknown") + title: chatInformationPage.chatInformation.title !== "" ? Emoji.emojify(chatInformationPage.chatInformation.title, Theme.fontSizeLarge) : qsTr("Unknown") description: chatInformationPage.isPrivateChat ? ("@"+(chatInformationPage.privateChatUserInformation.username || chatInformationPage.chatPartnerGroupId)) : "" } diff --git a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml index ef0ddc1..873302c 100644 --- a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml +++ b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml @@ -77,18 +77,18 @@ ChatInformationTabItemBase { width: parent.width // chat title - primaryText.text: Emoji.emojify(Functions.getUserName(user), primaryText.font.pixelSize, "../js/emoji/") + primaryText.text: Emoji.emojify(Functions.getUserName(user), primaryText.font.pixelSize) // last user prologSecondaryText.text: "@"+(user.username !== "" ? user.username : user_id) + (user_id === chatInformationPage.myUserId ? " " + qsTr("You") : "") secondaryText { horizontalAlignment: Text.AlignRight 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) : "" text: (statusText !== "" && customText !== "") ? statusText + ", " + customText : statusText + customText } tertiaryText { 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)) : Functions.getChatPartnerStatusText(user.status["@type"], user.status.was_online); elide: Text.ElideRight } @@ -160,7 +160,7 @@ ChatInformationTabItemBase { onChatChanged: { if (changedChatId === chat_id) { // Force update of some list item elements (currently only last message text seems to create problems). dataChanged() doesn't seem to trigger them all :( - secondaryText.text = last_message_text ? Emoji.emojify(Functions.enhanceHtmlEntities(last_message_text), Theme.fontSizeExtraSmall, "../../js/emoji/") : qsTr("Unknown") + secondaryText.text = last_message_text ? Emoji.emojify(Functions.enhanceHtmlEntities(last_message_text), Theme.fontSizeExtraSmall) : qsTr("Unknown") } } } diff --git a/qml/components/chatInformationPage/ChatInformationTextItem.qml b/qml/components/chatInformationPage/ChatInformationTextItem.qml index d93d3b7..db9ca5f 100644 --- a/qml/components/chatInformationPage/ChatInformationTextItem.qml +++ b/qml/components/chatInformationPage/ChatInformationTextItem.qml @@ -50,7 +50,7 @@ Column { font.pixelSize: Theme.fontSizeSmall textFormat: Text.StyledText color: Theme.primaryColor - text: Emoji.emojify( Functions.replaceUrlsWithLinks(textItem.text).replace(/\n/g, "
"), Theme.fontSizeExtraSmall, "../../js/emoji/") + text: Emoji.emojify( Functions.replaceUrlsWithLinks(textItem.text).replace(/\n/g, "
"), Theme.fontSizeExtraSmall) linkColor: Theme.highlightColor visible: text !== "" onLinkActivated: {