2020-11-17 19:01:50 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2020-11-17 19:01:50 +00:00
|
|
|
|
2021-10-21 23:34:35 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
2020-11-17 19:01:50 +00:00
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
property string chatId: ""
|
|
|
|
property string name: "channelName"
|
|
|
|
property string message: "My latest message\n with a return"
|
2023-01-20 19:01:32 +00:00
|
|
|
property int chatType: Constants.chatType.unknown
|
2020-11-17 19:01:50 +00:00
|
|
|
|
|
|
|
color: "#F7F7F7"
|
|
|
|
width: 366
|
|
|
|
height: 75
|
|
|
|
|
2021-12-08 21:20:43 +00:00
|
|
|
anchors.top: Global.applicationWindow.top
|
2020-11-17 19:01:50 +00:00
|
|
|
radius: Style.current.radius
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: identicon
|
2022-04-04 11:09:23 +00:00
|
|
|
sourceComponent: localAccountSensitiveSettings.notificationMessagePreviewSetting === Constants.settingsSection.notificationsBubble.previewAnonymous ? statusIdenticon : userOrChannelIdenticon
|
2020-11-17 19:01:50 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
height: 40
|
|
|
|
width: 40
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: userOrChannelIdenticon
|
2021-10-21 23:34:35 +00:00
|
|
|
StatusSmartIdenticon {
|
|
|
|
id: contactImage
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.width: 40
|
|
|
|
asset.height: 40
|
|
|
|
asset.letterSize: 15
|
|
|
|
asset.color: Theme.palette.miscColor5
|
2021-10-21 23:34:35 +00:00
|
|
|
name: root.name
|
2020-11-17 19:01:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: statusIdenticon
|
|
|
|
SVGImage {
|
2021-09-28 15:04:06 +00:00
|
|
|
source: Style.svg("status-logo-icon")
|
2020-11-17 19:01:50 +00:00
|
|
|
width: 40
|
|
|
|
height: 40
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: name
|
|
|
|
anchors.bottom: messagePreview.top
|
|
|
|
anchors.bottomMargin: 2
|
|
|
|
anchors.left: identicon.right
|
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
anchors.right: openButton.left
|
|
|
|
anchors.rightMargin: Style.current.smallPadding
|
|
|
|
elide: Text.ElideRight
|
|
|
|
text: root.name
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 15
|
|
|
|
color: Style.current.evenDarkerGrey
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: messagePreview
|
|
|
|
anchors.bottom: identicon.bottom
|
|
|
|
anchors.bottomMargin: 2
|
|
|
|
anchors.left: identicon.right
|
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
anchors.right: openButton.left
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
elide: Text.ElideRight
|
|
|
|
clip: true // This is needed because emojis don't ellide correctly
|
|
|
|
font.pixelSize: 14
|
|
|
|
color: Style.current.evenDarkerGrey
|
|
|
|
text: root.message
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: openButton
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: parent.height
|
|
|
|
width: 85
|
|
|
|
color: "transparent"
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
height: parent.height
|
|
|
|
width: 1.2
|
|
|
|
anchors.left: parent.left
|
|
|
|
color: "#D9D9D9"
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Open")
|
2020-11-17 19:01:50 +00:00
|
|
|
color: Style.current.darkerGrey
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|