mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 06:08:48 +03:00
Port invite dialog to use ItemDelegate
This commit is contained in:
parent
d645c43618
commit
07aa89cca1
1 changed files with 39 additions and 23 deletions
|
@ -98,37 +98,53 @@ ApplicationWindow {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
model: invitees
|
model: invitees
|
||||||
|
spacing: Nheko.paddingMedium
|
||||||
|
|
||||||
delegate: RowLayout {
|
delegate: ItemDelegate {
|
||||||
spacing: Nheko.paddingMedium
|
id: del
|
||||||
|
|
||||||
Avatar {
|
hoverEnabled: true
|
||||||
width: Nheko.avatarSize
|
width: ListView.view.width
|
||||||
height: Nheko.avatarSize
|
height: layout.implicitHeight
|
||||||
userid: model.mxid
|
onClicked: TimelineManager.openGlobalUserProfile(model.mxid)
|
||||||
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
|
background: Rectangle {
|
||||||
displayName: model.displayName
|
color: del.hovered ? Nheko.colors.dark : inviteDialogRoot.color
|
||||||
onClicked: TimelineManager.openGlobalUserProfile(model.mxid)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
RowLayout {
|
||||||
spacing: Nheko.paddingSmall
|
id: layout
|
||||||
|
|
||||||
Label {
|
spacing: Nheko.paddingMedium
|
||||||
text: model.displayName
|
|
||||||
color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window)
|
Avatar {
|
||||||
font.pointSize: fontMetrics.font.pointSize
|
width: Nheko.avatarSize
|
||||||
|
height: Nheko.avatarSize
|
||||||
|
userid: model.mxid
|
||||||
|
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
|
||||||
|
displayName: model.displayName
|
||||||
|
enabled: false
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
ColumnLayout {
|
||||||
text: model.mxid
|
spacing: Nheko.paddingSmall
|
||||||
color: Nheko.colors.buttonText
|
|
||||||
font.pointSize: fontMetrics.font.pointSize * 0.9
|
Label {
|
||||||
}
|
text: model.displayName
|
||||||
|
color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window)
|
||||||
|
font.pointSize: fontMetrics.font.pointSize
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: model.mxid
|
||||||
|
color: Nheko.colors.buttonText
|
||||||
|
font.pointSize: fontMetrics.font.pointSize * 0.9
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue