78 lines
1.9 KiB
QML
78 lines
1.9 KiB
QML
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import QtQuick
|
|
import org.kde.kirigami as Kirigami
|
|
import QtQuick.Controls as QQC2
|
|
import QtQuick.Layouts
|
|
import org.kde.kirigamiaddons.components as KirigamiComponents
|
|
import com.redstrate.sukai
|
|
|
|
RowLayout {
|
|
id: root
|
|
|
|
required property Author account
|
|
|
|
spacing: Kirigami.Units.largeSpacing
|
|
|
|
signal clicked()
|
|
|
|
KirigamiComponents.AvatarButton {
|
|
id: avatar
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
Layout.rowSpan: 5
|
|
|
|
source: root.account.avatar
|
|
cache: true
|
|
onClicked: root.clicked()
|
|
name: root.account.displayName
|
|
|
|
QQC2.ToolTip.text: i18n("View profile")
|
|
QQC2.ToolTip.visible: hovered
|
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
|
}
|
|
|
|
ColumnLayout {
|
|
id: layout
|
|
|
|
Layout.fillWidth: true
|
|
|
|
spacing: 0
|
|
clip: true
|
|
|
|
Kirigami.Heading {
|
|
level: 4
|
|
text: root.account.displayName
|
|
type: Kirigami.Heading.Type.Primary
|
|
verticalAlignment: Text.AlignTop
|
|
elide: Text.ElideRight
|
|
textFormat: Text.RichText
|
|
maximumLineCount: 1
|
|
|
|
Layout.fillWidth: true
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
onClicked: root.clicked()
|
|
}
|
|
}
|
|
|
|
QQC2.Label {
|
|
elide: Text.ElideRight
|
|
color: Kirigami.Theme.disabledTextColor
|
|
text: '@' + root.account.handle
|
|
verticalAlignment: Text.AlignTop
|
|
maximumLineCount: 1
|
|
|
|
Layout.fillWidth: true
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
onClicked: root.clicked()
|
|
}
|
|
}
|
|
}
|
|
}
|