/
erhoof
/
telegraf
Обзор
Документация
Войти
/
erhoof
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
qml/components/MessageViaLabel.qml
31 строка
1 KB
mbarashkov
Рефакторинг зависимостей qml
04 июн 2025, 15:27
04 июн 2025, 15:27
d215b57
Код
Авторство
О чём код?
import QtQuick 2.6 import Sailfish.Silica 1.0 import "../js/functions.js" as Functions import "../js/twemoji.js" as Emoji import ru.telegrafaurora.telegraf 1.0 Loader { id: botUserLoader active: !!viaBot width: parent.width asynchronous: true sourceComponent: Label { property var botUserInformation: TDLibDataRepository.getUserById(viaBot) 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://" + viaBot + "\">@" + botUserInformation.usernames.editable_username+"</a>") textFormat: Text.RichText truncationMode: TruncationMode.Fade onLinkActivated: { if(link === "userId://" + viaBot && botUserInformation.type.is_inline) { newMessageTextField.text = "@"+botUserInformation.usernames.editable_username+" " newMessageTextField.cursorPosition = newMessageTextField.text.length lostFocusTimer.start(); } else { Functions.handleLink(link); } } } property var viaBot }