mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 13:08:48 +03:00
Fixed anchoring/positioning of delegate items and join room display
This commit is contained in:
parent
d3d7844106
commit
98b733ad26
1 changed files with 25 additions and 10 deletions
|
@ -62,7 +62,7 @@ ApplicationWindow {
|
||||||
property color background: Nheko.colors.window
|
property color background: Nheko.colors.window
|
||||||
property color importantText: Nheko.colors.text
|
property color importantText: Nheko.colors.text
|
||||||
property color unimportantText: Nheko.colors.buttonText
|
property color unimportantText: Nheko.colors.buttonText
|
||||||
property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 2.5)
|
property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 4)
|
||||||
|
|
||||||
color: background
|
color: background
|
||||||
|
|
||||||
|
@ -115,13 +115,14 @@ ApplicationWindow {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredWidth: parent.width
|
Layout.preferredWidth: parent.width
|
||||||
spacing: Nheko.paddingSmall
|
spacing: Nheko.paddingSmall
|
||||||
Layout.alignment: Qt.AlignLeft
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
||||||
Layout.preferredHeight: Math.max(roomTopic.height, roomCount.height, joinRoomButton.height)
|
Layout.preferredHeight: Math.ceil(fontMetrics.lineSpacing * 4)
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
id: roomTopic
|
id: roomTopic
|
||||||
color: roomDirDelegate.unimportantText
|
color: roomDirDelegate.unimportantText
|
||||||
font.weight: Font.Thin
|
font.weight: Font.Thin
|
||||||
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
||||||
font.pixelSize: fontMetrics.font.pixelSize
|
font.pixelSize: fontMetrics.font.pixelSize
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 2
|
maximumLineCount: 2
|
||||||
|
@ -130,23 +131,37 @@ ApplicationWindow {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
|
Item {
|
||||||
|
id: numMembersRectangle
|
||||||
|
Layout.fillWidth: false
|
||||||
|
Layout.margins: Nheko.paddingSmall
|
||||||
|
width: roomCount.width
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
id: roomCount
|
id: roomCount
|
||||||
color: roomDirDelegate.unimportantText
|
color: roomDirDelegate.unimportantText
|
||||||
|
anchors.centerIn: parent
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
font.weight: Font.Thin
|
font.weight: Font.Thin
|
||||||
font.pixelSize: fontMetrics.font.pixelSize
|
font.pixelSize: fontMetrics.font.pixelSize
|
||||||
text: model.numMembers.toString()
|
text: model.numMembers.toString()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Button {
|
Item {
|
||||||
id: joinRoomButton
|
id: buttonRectangle
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
text: "Join"
|
Layout.margins: Nheko.paddingSmall
|
||||||
Layout.margins: Nheko.paddingSmall
|
width: joinRoomButton.width
|
||||||
onClicked: roomDir.joinRoom(model.index)
|
Button {
|
||||||
}
|
id: joinRoomButton
|
||||||
|
visible: roomDir.canJoinRoom(model.roomid)
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: Math.ceil(0.1 * roomDirectoryWindow.width)
|
||||||
|
text: "Join"
|
||||||
|
onClicked: roomDir.joinRoom(model.index)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue