/
NeoChapay
/
telegraf
Обзор
Документация
Войти
/
NeoChapay
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
qml/components/MessageViaLabel.qml
31 строка
1 KB
mbarashkov
Отказ от emojify в большинстве случаев; в некоторых случаях упрощение через короткий regexp
06 дек 2024, 15:45
06 дек 2024, 15:45
df4fd50
Код
Авторство
О чём код?
import QtQuick 2.6 import Sailfish.Silica 1.0 import "../js/functions.js" as Functions import "../js/twemoji.js" as Emoji Loader { id: botUserLoader active: !!message.via_bot_user_id width: parent.width asynchronous: true sourceComponent: Label { property var botUserInformation: tdLibWrapper.getUserInformation(message.via_bot_user_id) color: Theme.secondaryColor font.pixelSize: Theme.fontSizeExtraSmall text: qsTr("via %1", "message posted via bot user").arg("<a style=\"text-decoration: none; font-weight: bold; color:"+Theme.primaryColor+"\" href=\"userId://" + message.via_bot_user_id + "\">@" + botUserInformation.usernames.editable_username+"</a>") textFormat: Text.RichText truncationMode: TruncationMode.Fade onLinkActivated: { if(link === "userId://" + message.via_bot_user_id && botUserInformation.type.is_inline) { newMessageTextField.text = "@"+botUserInformation.usernames.editable_username+" " newMessageTextField.cursorPosition = newMessageTextField.text.length lostFocusTimer.start(); } else { Functions.handleLink(link); } } } property var message }