/
NeoChapay
/
telegraf
Обзор
Документация
Войти
/
NeoChapay
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
qml/components/messageContent/MessageDocument.qml
65 строк
2 KB
mbarashkov
Отказ от emojify в большинстве случаев; в некоторых случаях упрощение через короткий regexp
06 дек 2024, 15:45
06 дек 2024, 15:45
df4fd50
Код
Авторство
О чём код?
import QtQuick 2.6 import Sailfish.Silica 1.0 import "../../js/twemoji.js" as Emoji import "../../js/functions.js" as Functions MessageContentFileInfoBase { id: contentItem fileInformation: rawMessage.content.document.document primaryText:rawMessage.content.document.file_name secondaryText: "" minithumbnail: rawMessage.content.document.minithumbnail thumbnail: rawMessage.content.document.thumbnail leftButton { icon.source: Theme.iconForMimeType(rawMessage.content.document.mime_type) onClicked: { if(file.isDownloadingCompleted) { // in this case, the MouseArea should take over tdLibWrapper.copyFileToDownloads(file.path, true); } else if(!file.isDownloadingActive) { file.load(); } else { file.cancel() } } } states: [ State { when: file.isDownloadingCompleted PropertyChanges { target: openMouseArea; enabled: true } PropertyChanges { target: primaryLabel color: (contentItem.highlighted || openMouseArea.pressed) ? Theme.highlightColor : Theme.primaryColor } PropertyChanges { target: secondaryLabel color: (contentItem.highlighted || openMouseArea.pressed) ? Theme.secondaryHighlightColor : Theme.secondaryColor } PropertyChanges { target: tertiaryLabel color: (contentItem.highlighted || openMouseArea.pressed) ? Theme.secondaryHighlightColor : Theme.secondaryColor } PropertyChanges { target: leftButton highlighted: contentItem.highlighted || openMouseArea.pressed } } ] MouseArea { id: openMouseArea enabled: file.isDownloadingCompleted visible: enabled anchors { fill: primaryItem rightMargin: copyButton.width } onClicked: { tdLibWrapper.copyFileToDownloads(file.path, true); } } }