2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtQuick.Controls 2.15
|
2022-07-19 13:45:27 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
2023-02-23 16:01:34 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2022-07-19 13:45:27 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property alias primaryText: primaryText.text
|
|
|
|
property alias secondaryText: secondaryText.text
|
2022-08-08 21:12:12 +00:00
|
|
|
property alias primaryLabel: primaryText
|
|
|
|
property alias secondaryLabel: secondaryText
|
2022-07-19 13:45:27 +00:00
|
|
|
property alias tagsModel: tags.model
|
|
|
|
property alias tagsDelegate: tags.delegate
|
|
|
|
property int maxWidth: 0
|
2023-02-20 12:55:39 +00:00
|
|
|
property bool copy: false
|
2023-03-15 09:17:25 +00:00
|
|
|
property bool isLoading: false
|
2022-07-19 13:45:27 +00:00
|
|
|
|
2023-02-20 12:55:39 +00:00
|
|
|
signal copyClicked(string textToCopy)
|
|
|
|
|
|
|
|
implicitHeight: root.copy ? 75 : 52
|
2024-10-15 19:26:12 +00:00
|
|
|
implicitWidth: layout.width + Theme.xlPadding
|
|
|
|
radius: Theme.radius
|
2022-07-19 13:45:27 +00:00
|
|
|
border.width: 1
|
|
|
|
border.color: Theme.palette.baseColor2
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.transparent
|
2022-07-19 13:45:27 +00:00
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: layout
|
2022-07-28 20:56:44 +00:00
|
|
|
spacing: 0
|
2022-07-19 13:45:27 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
StatusBaseText {
|
|
|
|
id: primaryText
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.maximumWidth: root.maxWidth - Theme.xlPadding
|
2022-07-19 13:45:27 +00:00
|
|
|
font.pixelSize: 13
|
|
|
|
color: Theme.palette.directColor5
|
|
|
|
visible: text
|
|
|
|
elide: Text.ElideRight
|
|
|
|
}
|
2023-02-20 12:55:39 +00:00
|
|
|
RowLayout {
|
|
|
|
width: 100
|
2023-03-15 09:17:25 +00:00
|
|
|
StatusTextWithLoadingState {
|
2023-02-20 12:55:39 +00:00
|
|
|
id: secondaryText
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.maximumWidth: root.maxWidth - Theme.xlPadding - (root.copy ? 50 : 0)
|
2023-02-20 12:55:39 +00:00
|
|
|
font.pixelSize: 15
|
2023-03-15 09:17:25 +00:00
|
|
|
customColor: Theme.palette.directColor1
|
2023-02-20 12:55:39 +00:00
|
|
|
visible: text
|
|
|
|
elide: Text.ElideRight
|
2023-03-15 09:17:25 +00:00
|
|
|
loading: root.isLoading
|
2023-02-20 12:55:39 +00:00
|
|
|
}
|
|
|
|
CopyToClipBoardButton {
|
|
|
|
visible: root.copy
|
|
|
|
icon.width: 15
|
|
|
|
icon.height: 15
|
|
|
|
type: StatusRoundButton.Type.Tertiary
|
|
|
|
color: "transparent"
|
|
|
|
icon.color: Theme.palette.directColor1
|
|
|
|
textToCopy: secondaryText.text
|
|
|
|
onCopyClicked: root.copyClicked(textToCopy)
|
|
|
|
}
|
2022-07-19 13:45:27 +00:00
|
|
|
}
|
|
|
|
ScrollView {
|
|
|
|
Layout.preferredHeight: 24
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.maximumWidth: root.maxWidth - Theme.xlPadding
|
2022-07-19 13:45:27 +00:00
|
|
|
clip: true
|
|
|
|
visible: tags.count > 0
|
|
|
|
ListView {
|
|
|
|
id: tags
|
|
|
|
orientation: ListView.Horizontal
|
|
|
|
spacing: 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|