feat(Chat): introduce Profile Popup
This is a simple profile popup that will get more functionality in future commits. Closes #126
This commit is contained in:
parent
48f64eeb91
commit
ffd356d182
|
@ -5,6 +5,7 @@ import QtQuick.Layouts 1.3
|
|||
import Qt.labs.platform 1.1
|
||||
import "../../../../shared"
|
||||
import "../../../../imports"
|
||||
import "../components"
|
||||
|
||||
Item {
|
||||
property string userName: "Jotaro Kujo"
|
||||
|
@ -19,6 +20,10 @@ Item {
|
|||
width: parent.width
|
||||
height: contentType == Constants.stickerType ? stickerId.height : (isCurrentUser || (!isCurrentUser && !repeatMessageInfo) ? chatBox.height : 24 + chatBox.height)
|
||||
|
||||
ProfilePopup {
|
||||
id: profilePopup
|
||||
}
|
||||
|
||||
Image {
|
||||
id: chatImage
|
||||
width: 36
|
||||
|
@ -30,6 +35,14 @@ Item {
|
|||
fillMode: Image.PreserveAspectFit
|
||||
source: identicon
|
||||
visible: repeatMessageInfo && !isCurrentUser
|
||||
|
||||
MouseArea {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
profilePopup.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextEdit {
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
import "../../../../imports"
|
||||
import "../../../../shared"
|
||||
import "./"
|
||||
|
||||
ModalPopup {
|
||||
id: popup
|
||||
title: qsTr("User profile")
|
||||
|
||||
Rectangle {
|
||||
id: profilePic
|
||||
width: 120
|
||||
height: 120
|
||||
radius: 100
|
||||
border.color: "#10000000"
|
||||
border.width: 1
|
||||
color: Theme.transparent
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 16
|
||||
Image {
|
||||
width: 120
|
||||
height: 120
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: identicon
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: userNameText
|
||||
text: userName
|
||||
anchors.top: profilePic.bottom
|
||||
anchors.topMargin: 16
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.bold: true
|
||||
font.pixelSize: 16
|
||||
}
|
||||
|
||||
TextEdit {
|
||||
text: fromAuthor.substr(0, 6) + "..." + fromAuthor.substr(fromAuthor.length - 4)
|
||||
anchors.top: userNameText.bottom
|
||||
anchors.topMargin: 12
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
wrapMode: Text.Wrap
|
||||
readOnly: true
|
||||
selectByMouse: true
|
||||
color: Theme.darkGrey
|
||||
font.pixelSize: 15
|
||||
}
|
||||
|
||||
footer: StyledButton {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.smallPadding
|
||||
label: "Close"
|
||||
anchors.bottom: parent.bottom
|
||||
onClicked: {
|
||||
profilePopup.close()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
SuggestedChannel 1.0 SuggestedChannel.qml
|
||||
PublicChatPopup 1.0 PublicChatPopup.qml
|
||||
PrivateChatPopup 1.0 PrivateChatPopup.qml
|
||||
ProfilePropup 1.0 ProfilePopup.qml
|
||||
ChannelIcon 1.0 ChannelIcon.qml
|
||||
|
|
Loading…
Reference in New Issue