/
erhoof
/
telegraf
Обзор
Документация
Войти
/
erhoof
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
qml/components/topicIcon/TopicIconRender.qml
58 строк
2 KB
Nikolay Sinyov
Все изменения учел для ChatPage
10 сен 2025, 19:51
10 сен 2025, 19:51
5b4298c
Код
Авторство
О чём код?
import QtQuick 2.6 import Sailfish.Silica 1.0 import ru.telegrafaurora.telegraf 1.0 import "../../js/twemoji.js" as Emoji Item { id: topicIconRender property int topicColor: 0 property bool isGeneral: false property bool isPinned: false property bool hasCustomEmoji: false property string emojiText: "" width: Theme.itemSizeSmall height: Theme.itemSizeSmall visible: true Rectangle { id: background anchors.fill: parent radius: Theme.paddingMedium color: topicColor ? Qt.rgba( ((topicColor >> 16) & 0xff)/255, ((topicColor >> 8) & 0xff)/255, (topicColor & 0xff)/255, 0.7 ) : Theme.secondaryColor } Label { anchors.centerIn: background text: hasCustomEmoji ? Emoji.emojify(emojiText, Theme.fontSizeLarge) : Emoji.emojify(isGeneral ? "#" : "💬", Theme.fontSizeLarge) color: Theme.primaryColor font.pixelSize: Theme.fontSizeLarge } // Pinned badge Rectangle { id: topicPinnedBackground color: Theme.rgba(Theme.overlayBackgroundColor, Theme.opacityFaint) width: Theme.fontSizeLarge height: Theme.fontSizeLarge anchors.top: background.top anchors.left: background.left radius: background.width / 2 visible: isPinned } Icon { source: "../../../images/icon-s-pin.svg" height: Theme.iconSizeExtraSmall width: Theme.iconSizeExtraSmall sourceSize: Qt.size(Theme.iconSizeExtraSmall, Theme.iconSizeExtraSmall) anchors.centerIn: topicPinnedBackground visible: isPinned } }