2021-10-01 15:58:36 +00:00
|
|
|
import QtQuick 2.3
|
2022-10-28 14:25:48 +00:00
|
|
|
import QtQuick.Layouts 1.3
|
2021-10-01 15:58:36 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2022-10-13 15:52:44 +00:00
|
|
|
|
2022-10-28 14:25:48 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
2021-10-01 15:58:36 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2022-10-13 15:52:44 +00:00
|
|
|
import shared.controls 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-10-28 14:25:48 +00:00
|
|
|
implicitWidth: layout.implicitWidth + layout.anchors.leftMargin + layout.anchors.rightMargin
|
|
|
|
implicitHeight: layout.implicitHeight + layout.anchors.topMargin + layout.anchors.bottomMargin
|
2022-09-23 14:14:31 +00:00
|
|
|
|
2022-10-28 14:25:48 +00:00
|
|
|
RowLayout {
|
|
|
|
id: layout
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-10-28 14:25:48 +00:00
|
|
|
anchors {
|
|
|
|
fill: parent
|
|
|
|
leftMargin: 8
|
|
|
|
rightMargin: 8
|
|
|
|
topMargin: 3
|
|
|
|
bottomMargin: 3
|
|
|
|
}
|
|
|
|
|
|
|
|
spacing: 4
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-10-28 14:25:48 +00:00
|
|
|
StatusIcon {
|
|
|
|
Layout.preferredWidth: 16
|
|
|
|
Layout.preferredHeight: 16
|
|
|
|
icon: "tiny/community"
|
|
|
|
color: Theme.palette.baseColor1
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
|
2022-10-28 14:25:48 +00:00
|
|
|
StatusSmartIdenticon {
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
name: root.communityName
|
|
|
|
asset.width: 16
|
|
|
|
asset.height: 16
|
|
|
|
asset.letterSize: 11
|
|
|
|
asset.color: root.communityColor
|
|
|
|
asset.name: root.communityImage
|
|
|
|
asset.isImage: true
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
spacing: 0
|
2022-10-29 07:17:35 +00:00
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2022-10-28 14:25:48 +00:00
|
|
|
|
|
|
|
StyledTextEdit {
|
|
|
|
Layout.maximumWidth: 300
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
text: Utils.getLinkStyle(root.communityName, hoveredLink, Theme.palette.baseColor1)
|
|
|
|
readOnly: true
|
|
|
|
textFormat: Text.RichText
|
|
|
|
clip: true
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
font.pixelSize: 13
|
|
|
|
font.weight: Font.Medium
|
|
|
|
onLinkActivated: {
|
|
|
|
root.communityNameClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusIcon {
|
|
|
|
Layout.preferredWidth: 16
|
|
|
|
Layout.preferredHeight: 16
|
2022-10-29 07:17:35 +00:00
|
|
|
visible: root.channelName.length > 0
|
2022-10-28 14:25:48 +00:00
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledTextEdit {
|
|
|
|
Layout.maximumWidth: 300
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2022-10-29 07:17:35 +00:00
|
|
|
visible: root.channelName.length > 0
|
2022-10-28 14:25:48 +00:00
|
|
|
text: Utils.getLinkStyle("#" + root.channelName, hoveredLink, Theme.palette.baseColor1)
|
|
|
|
readOnly: true
|
|
|
|
textFormat: Text.RichText
|
|
|
|
clip: true
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
font.pixelSize: 13
|
|
|
|
font.weight: Font.Medium
|
|
|
|
onLinkActivated: {
|
|
|
|
root.channelNameClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
}
|