mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +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 userid
|
||||||
property string displayName
|
property string displayName
|
||||||
|
|
||||||
|
signal clicked(var mouse)
|
||||||
|
|
||||||
width: 48
|
width: 48
|
||||||
height: 48
|
height: 48
|
||||||
radius: Settings.avatarCircles ? height / 2 : 3
|
radius: Settings.avatarCircles ? height / 2 : 3
|
||||||
color: colors.alternateBase
|
color: colors.alternateBase
|
||||||
|
Component.onCompleted: {
|
||||||
|
mouseArea.clicked.connect(clicked);
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -43,7 +48,6 @@ Rectangle {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
|
||||||
|
|
||||||
Ripple {
|
Ripple {
|
||||||
rippleTarget: mouseArea
|
rippleTarget: mouseArea
|
||||||
|
|
|
@ -104,6 +104,7 @@ Popup {
|
||||||
width: 24
|
width: 24
|
||||||
displayName: model.displayName
|
displayName: model.displayName
|
||||||
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
|
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
|
||||||
|
onClicked: popup.completionClicked(completer.completionAt(model.index))
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
|
@ -108,19 +108,19 @@ ListView {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
Avatar {
|
Avatar {
|
||||||
|
// MouseArea {
|
||||||
|
// anchors.fill: parent
|
||||||
|
// onClicked: chat.model.openUserProfile(modelData.userId)
|
||||||
|
// cursorShape: Qt.PointingHandCursor
|
||||||
|
// propagateComposedEvents: true
|
||||||
|
// }
|
||||||
|
|
||||||
width: avatarSize
|
width: avatarSize
|
||||||
height: avatarSize
|
height: avatarSize
|
||||||
url: chat.model.avatarUrl(modelData.userId).replace("mxc://", "image://MxcImage/")
|
url: chat.model.avatarUrl(modelData.userId).replace("mxc://", "image://MxcImage/")
|
||||||
displayName: modelData.userName
|
displayName: modelData.userName
|
||||||
userid: modelData.userId
|
userid: modelData.userId
|
||||||
|
onClicked: chat.model.openUserProfile(modelData.userId)
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: chat.model.openUserProfile(modelData.userId)
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
propagateComposedEvents: true
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
|
@ -53,12 +53,7 @@ Rectangle {
|
||||||
height: avatarSize
|
height: avatarSize
|
||||||
url: room ? room.roomAvatarUrl.replace("mxc://", "image://MxcImage/") : ""
|
url: room ? room.roomAvatarUrl.replace("mxc://", "image://MxcImage/") : ""
|
||||||
displayName: room ? room.roomName : qsTr("No room selected")
|
displayName: room ? room.roomName : qsTr("No room selected")
|
||||||
|
onClicked: TimelineManager.openRoomSettings()
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: TimelineManager.openRoomSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
|
@ -37,6 +37,7 @@ ApplicationWindow {
|
||||||
displayName: profile.displayName
|
displayName: profile.displayName
|
||||||
userid: profile.userid
|
userid: profile.userid
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
|
@ -31,6 +31,7 @@ Rectangle {
|
||||||
height: avatarSize
|
height: avatarSize
|
||||||
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
|
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
|
||||||
displayName: CallManager.callParty
|
displayName: CallManager.callParty
|
||||||
|
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
|
@ -38,6 +38,7 @@ Rectangle {
|
||||||
height: avatarSize
|
height: avatarSize
|
||||||
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
|
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
|
||||||
displayName: CallManager.callParty
|
displayName: CallManager.callParty
|
||||||
|
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
|
@ -61,6 +61,7 @@ Popup {
|
||||||
height: avatarSize
|
height: avatarSize
|
||||||
url: TimelineManager.timeline.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
|
url: TimelineManager.timeline.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
|
||||||
displayName: TimelineManager.timeline.roomName
|
displayName: TimelineManager.timeline.roomName
|
||||||
|
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
Loading…
Reference in a new issue