mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
bf14b06d55
This adds the UI plus all necessary models and signal handling to render discord import progress in the desktop application. It also introduces message handling for discord chat message types. Requires status-im/status-go#2826 to function Co-authored with @caybro
61 lines
1.8 KiB
QML
61 lines
1.8 KiB
QML
import QtQuick 2.3
|
|
import shared.controls 1.0
|
|
import shared 1.0
|
|
import shared.panels 1.0
|
|
|
|
import utils 1.0
|
|
|
|
Item {
|
|
id: root
|
|
property bool isHovered: false
|
|
height: childrenRect.height
|
|
width: chatName.width + (ensOrAlias.visible ? ensOrAlias.width + ensOrAlias.anchors.leftMargin : 0)
|
|
property alias label: chatName
|
|
|
|
property string displayName
|
|
property string localName
|
|
property bool amISender
|
|
property bool disabled
|
|
|
|
signal clickMessage(bool isProfileClick)
|
|
|
|
StyledTextEdit {
|
|
id: chatName
|
|
text: root.amISender ? qsTr("You") : displayName
|
|
color: text.startsWith("@") || root.amISender || localName !== "" ? Style.current.blue : Style.current.secondaryText
|
|
font.weight: Font.Medium
|
|
font.pixelSize: Style.current.secondaryTextFontSize
|
|
font.underline: root.isHovered && !root.disabled
|
|
readOnly: true
|
|
wrapMode: Text.WordWrap
|
|
selectByMouse: true
|
|
MouseArea {
|
|
cursorShape: hoverEnabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
anchors.fill: parent
|
|
hoverEnabled: !root.disabled
|
|
onEntered: {
|
|
root.isHovered = true
|
|
}
|
|
onExited: {
|
|
root.isHovered = false
|
|
}
|
|
onClicked: {
|
|
if (!root.disabled) {
|
|
root.clickMessage(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
StyledText {
|
|
id: ensOrAlias
|
|
visible: localName !== "" && displayName.startsWith("@")
|
|
text: displayName
|
|
color: Style.current.secondaryText
|
|
font.pixelSize: chatName.font.pixelSize
|
|
anchors.left: chatName.right
|
|
anchors.leftMargin: chatName.visible ? 4 : 0
|
|
}
|
|
}
|