Ensure chat box and userInfo have the same height
This commit is contained in:
committed by
Tobias Fella
parent
c55b40c9c6
commit
213aaf3ac4
@@ -75,7 +75,7 @@ ColumnLayout {
|
|||||||
visible: currentRoom.canSendEvent("m.room.message")
|
visible: currentRoom.canSendEvent("m.room.message")
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: implicitHeight + Kirigami.Units.largeSpacing
|
Layout.minimumHeight: Math.max(Kirigami.Units.gridUnit * 2, implicitHeight + Kirigami.Units.largeSpacing)
|
||||||
// lineSpacing is height+leading, so subtract leading once since leading only exists between lines.
|
// lineSpacing is height+leading, so subtract leading once since leading only exists between lines.
|
||||||
Layout.maximumHeight: chatBarFontMetrics.lineSpacing * 8 - chatBarFontMetrics.leading + textField.topPadding + textField.bottomPadding
|
Layout.maximumHeight: chatBarFontMetrics.lineSpacing * 8 - chatBarFontMetrics.leading + textField.topPadding + textField.bottomPadding
|
||||||
|
|
||||||
|
|||||||
@@ -13,13 +13,10 @@ QQC2.ToolBar {
|
|||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
height: content.height
|
|
||||||
|
|
||||||
property var addAccount
|
property var addAccount
|
||||||
|
|
||||||
ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
id: content
|
id: content
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
@@ -107,7 +104,12 @@ QQC2.ToolBar {
|
|||||||
delegate: Kirigami.BasicListItem {
|
delegate: Kirigami.BasicListItem {
|
||||||
leftPadding: topPadding
|
leftPadding: topPadding
|
||||||
leading: Kirigami.Avatar {
|
leading: Kirigami.Avatar {
|
||||||
width: height
|
implicitWidth: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
|
||||||
|
implicitHeight: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
|
||||||
|
sourceSize {
|
||||||
|
width: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
|
||||||
|
height: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
|
||||||
|
}
|
||||||
source: model.connection.localUser.avatarMediaId ? ("image://mxc/" + model.connection.localUser.avatarMediaId) : ""
|
source: model.connection.localUser.avatarMediaId ? ("image://mxc/" + model.connection.localUser.avatarMediaId) : ""
|
||||||
name: model.connection.localUser.displayName ?? model.connection.localUser.id
|
name: model.connection.localUser.displayName ?? model.connection.localUser.id
|
||||||
}
|
}
|
||||||
@@ -131,32 +133,37 @@ QQC2.ToolBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 3
|
spacing: Kirigami.Units.largeSpacing
|
||||||
Item {
|
|
||||||
Layout.fillHeight: true
|
Layout.topMargin: Kirigami.Units.smallSpacing
|
||||||
Layout.preferredWidth: height
|
Layout.bottomMargin: Kirigami.Units.smallSpacing
|
||||||
Kirigami.Avatar {
|
Layout.minimumHeight: Kirigami.Units.gridUnit * 2 - 2 // HACK: -2 here is to ensure the ChatBox and the UserInfo have the same height
|
||||||
readonly property string mediaId: Controller.activeConnection.localUser.avatarMediaId
|
|
||||||
anchors.fill: parent
|
Kirigami.Avatar {
|
||||||
anchors.margins: Kirigami.Units.smallSpacing
|
readonly property string mediaId: Controller.activeConnection.localUser.avatarMediaId
|
||||||
source: mediaId ? ("image://mxc/" + mediaId) : ""
|
|
||||||
name: Controller.activeConnection.localUser.displayName ?? Controller.activeConnection.localUser.id
|
Layout.preferredWidth: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
|
||||||
actions.main: Kirigami.Action {
|
Layout.preferredHeight: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
|
||||||
text: i18n("Edit this account")
|
Layout.leftMargin: Kirigami.Units.largeSpacing
|
||||||
icon.name: "document-edit"
|
|
||||||
onTriggered: pageStack.pushDialogLayer(Qt.resolvedUrl('qrc:/AccountEditorPage.qml'), {
|
source: mediaId ? ("image://mxc/" + mediaId) : ""
|
||||||
connection: Controller.activeConnection
|
name: Controller.activeConnection.localUser.displayName ?? Controller.activeConnection.localUser.id
|
||||||
}, {
|
actions.main: Kirigami.Action {
|
||||||
title: i18n("Account editor")
|
text: i18n("Edit this account")
|
||||||
});
|
icon.name: "document-edit"
|
||||||
}
|
onTriggered: pageStack.pushDialogLayer(Qt.resolvedUrl('qrc:/AccountEditorPage.qml'), {
|
||||||
TapHandler {
|
connection: Controller.activeConnection
|
||||||
acceptedButtons: Qt.RightButton
|
}, {
|
||||||
acceptedDevices: PointerDevice.Mouse
|
title: i18n("Account editor")
|
||||||
onTapped: accountMenu.open()
|
});
|
||||||
}
|
}
|
||||||
|
TapHandler {
|
||||||
|
acceptedButtons: Qt.RightButton
|
||||||
|
acceptedDevices: PointerDevice.Mouse
|
||||||
|
onTapped: accountMenu.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 0
|
spacing: 0
|
||||||
@@ -212,9 +219,10 @@ QQC2.ToolBar {
|
|||||||
display: QQC2.AbstractButton.IconOnly
|
display: QQC2.AbstractButton.IconOnly
|
||||||
Layout.minimumWidth: Layout.preferredWidth
|
Layout.minimumWidth: Layout.preferredWidth
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
QQC2.ToolTip {
|
Layout.rightMargin: Kirigami.Units.largeSpacing
|
||||||
text: parent.text
|
QQC2.ToolTip.text: parent.text
|
||||||
}
|
QQC2.ToolTip.visible: hovered
|
||||||
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
width: 1
|
width: 1
|
||||||
|
|||||||
Reference in New Issue
Block a user