Cleanup leftover issues from moving ReplyComponent away from GridLayout

Cleanup leftover issues from moving ReplyComponent away from GridLayout.
- Remove leftover GridLayout properties or references to them or convert as required
- Remove unneeded Item wrapper
This commit is contained in:
James Graham
2023-12-23 11:37:01 +00:00
parent 134f1d2ae5
commit 4e141e05f0

View File

@@ -20,7 +20,7 @@ import org.kde.neochat
* show in their original form and are instead visualised with a MIME type delegate * show in their original form and are instead visualised with a MIME type delegate
* e.g. Videos. * e.g. Videos.
*/ */
Item { RowLayout {
id: root id: root
/** /**
@@ -75,19 +75,11 @@ Item {
*/ */
signal replyClicked() signal replyClicked()
implicitWidth: mainLayout.implicitWidth
implicitHeight: mainLayout.implicitHeight
RowLayout {
id: mainLayout
anchors.fill: parent
spacing: Kirigami.Units.largeSpacing spacing: Kirigami.Units.largeSpacing
Rectangle { Rectangle {
id: verticalBorder id: verticalBorder
Layout.fillHeight: true Layout.fillHeight: true
Layout.rowSpan: 2
implicitWidth: Kirigami.Units.smallSpacing implicitWidth: Kirigami.Units.smallSpacing
color: root.author.color color: root.author.color
@@ -151,7 +143,6 @@ Item {
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onTapped: root.replyClicked() onTapped: root.replyClicked()
} }
}
Component { Component {
id: textComponent id: textComponent
@@ -176,13 +167,13 @@ Item {
width: mediaSizeHelper.currentSize.width width: mediaSizeHelper.currentSize.width
height: mediaSizeHelper.currentSize.height height: mediaSizeHelper.currentSize.height
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: root.mediaInfo.source source: root?.mediaInfo.source ?? ""
MediaSizeHelper { MediaSizeHelper {
id: mediaSizeHelper id: mediaSizeHelper
contentMaxWidth: root.contentMaxWidth - verticalBorder.width - mainLayout.columnSpacing contentMaxWidth: root.contentMaxWidth - verticalBorder.width - root.spacing
mediaWidth: root.mediaInfo.width mediaWidth: root?.mediaInfo.width ?? -1
mediaHeight: root.mediaInfo.height mediaHeight: root?.mediaInfo.height ?? -1
} }
} }
} }