Fix(ActivityCenter): Fix reply badge text eliding

Close #8526
This commit is contained in:
MishkaRogachev 2022-12-01 14:33:25 +04:00 committed by Mikhail Rogachev
parent 0d217c0db0
commit 5d9d9a8f2a
1 changed files with 37 additions and 26 deletions

View File

@ -1,13 +1,13 @@
import QtQuick 2.4
import QtQuick.Layouts 1.4
import StatusQ.Core 0.1
import StatusQ.Core.Utils 0.1 as StatusQUtils
import utils 1.0
import shared.controls 1.0
import shared.panels 1.0
import StatusQ.Core.Utils 0.1 as StatusQUtils
Badge {
id: root
@ -15,32 +15,43 @@ Badge {
signal replyClicked()
SVGImage {
id: replyIcon
anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding
anchors.verticalCenter: parent.verticalCenter
width: 16
height: width
source: Style.svg("reply-small-arrow")
}
implicitWidth: layout.implicitWidth + layout.anchors.leftMargin + layout.anchors.rightMargin
implicitHeight: layout.implicitHeight + layout.anchors.topMargin + layout.anchors.bottomMargin
StatusBaseText {
anchors.left: replyIcon.right
anchors.leftMargin: 4
anchors.verticalCenter: parent.verticalCenter
width: Math.min(implicitWidth, 300)
text: repliedMessageContent
maximumLineCount: 1
elide: Text.ElideRight
font.pixelSize: 13
RowLayout {
id: layout
MouseArea {
id: replyArea
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: root.replyClicked()
anchors {
fill: parent
leftMargin: 8
rightMargin: 8
topMargin: 3
bottomMargin: 3
}
spacing: 4
StatusIcon {
source: Style.svg("reply-small-arrow")
Layout.preferredWidth: 16
Layout.preferredHeight: 16
}
StatusBaseText {
text: repliedMessageContent
maximumLineCount: 1
wrapMode: Text.Wrap
elide: Text.ElideRight
font.pixelSize: 13
Layout.maximumWidth: 300
Layout.alignment: Qt.AlignVCenter
}
}
MouseArea {
hoverEnabled: true
anchors.fill: layout
cursorShape: Qt.PointingHandCursor
onClicked: root.replyClicked()
}
}