2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2022-11-16 17:17:38 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
2023-06-15 14:33:49 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-12-01 10:33:25 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.controls 1.0
|
|
|
|
import shared.panels 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-09-23 14:14:31 +00:00
|
|
|
Badge {
|
|
|
|
id: root
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-05-10 16:04:25 +00:00
|
|
|
property string repliedMessageContent
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-09-23 14:14:31 +00:00
|
|
|
signal replyClicked()
|
|
|
|
|
2022-12-01 10:33:25 +00:00
|
|
|
implicitWidth: layout.implicitWidth + layout.anchors.leftMargin + layout.anchors.rightMargin
|
|
|
|
implicitHeight: layout.implicitHeight + layout.anchors.topMargin + layout.anchors.bottomMargin
|
2024-10-15 19:26:12 +00:00
|
|
|
color: hoverArea.containsMouse ? hoverArea.pressed ? Theme.palette.baseColor3 : Theme.palette.baseColor2 : Theme.palette.transparent
|
2022-12-01 10:33:25 +00:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: layout
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
fill: parent
|
|
|
|
leftMargin: 8
|
|
|
|
rightMargin: 8
|
|
|
|
topMargin: 3
|
|
|
|
bottomMargin: 3
|
|
|
|
}
|
|
|
|
|
|
|
|
spacing: 4
|
|
|
|
|
|
|
|
StatusIcon {
|
2024-10-15 19:26:12 +00:00
|
|
|
source: Theme.svg("reply-small-arrow")
|
2022-12-01 10:33:25 +00:00
|
|
|
Layout.preferredWidth: 16
|
|
|
|
Layout.preferredHeight: 16
|
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
|
2022-12-01 10:33:25 +00:00
|
|
|
StatusBaseText {
|
|
|
|
text: repliedMessageContent
|
|
|
|
maximumLineCount: 1
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
elide: Text.ElideRight
|
|
|
|
font.pixelSize: 13
|
|
|
|
Layout.maximumWidth: 300
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2022-10-29 07:17:35 +00:00
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
2022-12-01 10:33:25 +00:00
|
|
|
|
|
|
|
MouseArea {
|
2023-06-15 14:33:49 +00:00
|
|
|
id: hoverArea
|
2022-12-01 10:33:25 +00:00
|
|
|
hoverEnabled: true
|
|
|
|
anchors.fill: layout
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: root.replyClicked()
|
|
|
|
}
|
2022-11-29 11:57:07 +00:00
|
|
|
}
|