mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 06:08:48 +03:00
Clean up Avatar click event handling
This commit is contained in:
parent
22f7841848
commit
9a604d3821
8 changed files with 19 additions and 15 deletions
|
@ -11,10 +11,15 @@ Rectangle {
|
|||
property string userid
|
||||
property string displayName
|
||||
|
||||
signal clicked(var mouse)
|
||||
|
||||
width: 48
|
||||
height: 48
|
||||
radius: Settings.avatarCircles ? height / 2 : 3
|
||||
color: colors.alternateBase
|
||||
Component.onCompleted: {
|
||||
mouseArea.clicked.connect(clicked);
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.fill: parent
|
||||
|
@ -43,7 +48,6 @@ Rectangle {
|
|||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||
|
||||
Ripple {
|
||||
rippleTarget: mouseArea
|
||||
|
|
|
@ -104,6 +104,7 @@ Popup {
|
|||
width: 24
|
||||
displayName: model.displayName
|
||||
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
|
||||
onClicked: popup.completionClicked(completer.completionAt(model.index))
|
||||
}
|
||||
|
||||
Label {
|
||||
|
|
|
@ -108,19 +108,19 @@ ListView {
|
|||
spacing: 8
|
||||
|
||||
Avatar {
|
||||
// MouseArea {
|
||||
// anchors.fill: parent
|
||||
// onClicked: chat.model.openUserProfile(modelData.userId)
|
||||
// cursorShape: Qt.PointingHandCursor
|
||||
// propagateComposedEvents: true
|
||||
// }
|
||||
|
||||
width: avatarSize
|
||||
height: avatarSize
|
||||
url: chat.model.avatarUrl(modelData.userId).replace("mxc://", "image://MxcImage/")
|
||||
displayName: modelData.userName
|
||||
userid: modelData.userId
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: chat.model.openUserProfile(modelData.userId)
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
propagateComposedEvents: true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Label {
|
||||
|
|
|
@ -53,14 +53,9 @@ Rectangle {
|
|||
height: avatarSize
|
||||
url: room ? room.roomAvatarUrl.replace("mxc://", "image://MxcImage/") : ""
|
||||
displayName: room ? room.roomName : qsTr("No room selected")
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: TimelineManager.openRoomSettings()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
Layout.column: 2
|
||||
|
|
|
@ -37,6 +37,7 @@ ApplicationWindow {
|
|||
displayName: profile.displayName
|
||||
userid: profile.userid
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||
}
|
||||
|
||||
Label {
|
||||
|
|
|
@ -31,6 +31,7 @@ Rectangle {
|
|||
height: avatarSize
|
||||
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
|
||||
displayName: CallManager.callParty
|
||||
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||
}
|
||||
|
||||
Label {
|
||||
|
|
|
@ -38,6 +38,7 @@ Rectangle {
|
|||
height: avatarSize
|
||||
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
|
||||
displayName: CallManager.callParty
|
||||
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||
}
|
||||
|
||||
Label {
|
||||
|
|
|
@ -61,6 +61,7 @@ Popup {
|
|||
height: avatarSize
|
||||
url: TimelineManager.timeline.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
|
||||
displayName: TimelineManager.timeline.roomName
|
||||
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||
}
|
||||
|
||||
Button {
|
||||
|
|
Loading…
Reference in a new issue