2021-10-01 15:58:36 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import Qt.labs.platform 1.1
|
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2022-10-28 14:25:48 +00:00
|
|
|
import shared.controls 1.0
|
2021-10-21 23:34:35 +00:00
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core 0.1
|
2022-03-07 14:56:05 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2022-10-28 14:25:48 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
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-21 13:00:35 +00:00
|
|
|
signal channelNameClicked()
|
|
|
|
|
2022-10-28 14:25:48 +00:00
|
|
|
property int chatType: -1
|
2021-10-01 15:58:36 +00:00
|
|
|
property string name: "channelName"
|
|
|
|
property color textColor
|
|
|
|
|
2022-10-28 14:25:48 +00:00
|
|
|
property StatusAssetSettings asset: StatusAssetSettings {
|
2021-10-01 15:58:36 +00:00
|
|
|
width: 16
|
|
|
|
height: 16
|
2022-10-28 14:25:48 +00:00
|
|
|
letterSize: 11
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: layout
|
|
|
|
|
|
|
|
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: chatType === Constants.chatType.publicChat ? "tiny/public-chat"
|
|
|
|
: "tiny/group"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSmartIdenticon {
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
asset: root.asset
|
|
|
|
name: root.name
|
|
|
|
}
|
2022-10-29 07:17:35 +00:00
|
|
|
|
2022-10-28 14:25:48 +00:00
|
|
|
StyledText {
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
text: chatType !== Constants.chatType.publicChat ?
|
|
|
|
StatusQUtils.Emoji.parse(Utils.removeStatusEns(StatusQUtils.Utils.filterXSS(name))) :
|
|
|
|
"#" + StatusQUtils.Utils.filterXSS(name)
|
|
|
|
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 13
|
2022-10-29 07:17:35 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: replyArea
|
|
|
|
hoverEnabled: true
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: root.channelNameClicked()
|
|
|
|
}
|
2022-10-28 14:25:48 +00:00
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
}
|