2021-10-01 15:58:36 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtGraphicalEffects 1.13
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.controls 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-09-21 13:00:35 +00:00
|
|
|
Badge {
|
2022-09-22 16:35:18 +00:00
|
|
|
id: root
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-09-22 16:35:18 +00:00
|
|
|
property string communityImage
|
|
|
|
property string communityName
|
|
|
|
property string communityColor
|
|
|
|
|
|
|
|
property string channelName
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
signal communityNameClicked()
|
|
|
|
signal channelNameClicked()
|
|
|
|
|
2022-09-23 14:14:31 +00:00
|
|
|
SVGImage {
|
|
|
|
id: communityIcon
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
anchors.verticalCenter:parent.verticalCenter
|
|
|
|
width: 16
|
|
|
|
height: 16
|
|
|
|
source: Style.svg("communities")
|
|
|
|
}
|
|
|
|
|
2022-09-22 16:35:18 +00:00
|
|
|
StatusSmartIdenticon {
|
|
|
|
id: identicon
|
2022-09-23 14:14:31 +00:00
|
|
|
anchors.left: communityIcon.right
|
2022-09-22 16:35:18 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2021-10-01 15:58:36 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2022-09-22 16:35:18 +00:00
|
|
|
name: root.communityName
|
|
|
|
asset.width: 16
|
|
|
|
asset.height: 16
|
|
|
|
asset.color: root.communityColor
|
|
|
|
asset.letterSize: width / 2.4
|
|
|
|
asset.name: root.communityImage
|
|
|
|
asset.isImage: true
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledTextEdit {
|
2022-09-22 16:35:18 +00:00
|
|
|
id: communityNameText
|
|
|
|
width: implicitWidth > 300 ? 300 : implicitWidth
|
2021-10-01 15:58:36 +00:00
|
|
|
height: 18
|
2022-09-22 16:35:18 +00:00
|
|
|
anchors.left: identicon.right
|
|
|
|
anchors.leftMargin: 4
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
text: Utils.getLinkStyle(root.communityName, hoveredLink, root.communityColor)
|
2021-10-01 15:58:36 +00:00
|
|
|
readOnly: true
|
|
|
|
textFormat: Text.RichText
|
|
|
|
clip: true
|
2022-09-22 16:35:18 +00:00
|
|
|
color: root.communityColor
|
2021-10-01 15:58:36 +00:00
|
|
|
font.pixelSize: 13
|
2022-09-22 16:35:18 +00:00
|
|
|
onLinkActivated: root.communityNameClicked()
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: caretImage
|
|
|
|
source: Style.svg("show-category")
|
|
|
|
width: 16
|
|
|
|
height: 16
|
2022-09-22 16:35:18 +00:00
|
|
|
visible: root.channelName.length
|
|
|
|
anchors.left: communityNameText.right
|
2021-10-01 15:58:36 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: parent
|
|
|
|
source: parent
|
2022-09-22 16:35:18 +00:00
|
|
|
color: root.communityColor
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledTextEdit {
|
2022-09-22 16:35:18 +00:00
|
|
|
id: channelNameText
|
|
|
|
width: implicitWidth > 300 ? 300 : implicitWidth
|
2021-10-01 15:58:36 +00:00
|
|
|
height: 18
|
2022-09-22 16:35:18 +00:00
|
|
|
anchors.left: caretImage.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
text: Utils.getLinkStyle(root.channelName || name, hoveredLink, root.channelColor)
|
2021-10-01 15:58:36 +00:00
|
|
|
readOnly: true
|
|
|
|
textFormat: Text.RichText
|
|
|
|
clip: true
|
2022-09-22 16:35:18 +00:00
|
|
|
color: root.communityColor
|
2021-10-01 15:58:36 +00:00
|
|
|
font.pixelSize: 13
|
2022-09-22 16:35:18 +00:00
|
|
|
onLinkActivated: root.channelNameClicked()
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
}
|