ImageComponent: add a parent Item to anchor everything to

This commit is contained in:
Darshan Phaldesai
2026-02-25 18:17:37 -07:00
parent cab57cc656
commit 43bde4c9d2

View File

@@ -57,13 +57,18 @@ Item {
property int rightAnchorMargin: 0 property int rightAnchorMargin: 0
Layout.fillWidth: true Layout.fillWidth: true
implicitWidth: container.implicitWidth
implicitHeight: container.implicitHeight
Item {
id: container
implicitWidth: mediaSizeHelper.currentSize.width implicitWidth: mediaSizeHelper.currentSize.width
implicitHeight: mediaSizeHelper.currentSize.height implicitHeight: mediaSizeHelper.currentSize.height
RowLayout { RowLayout {
anchors.top: root.top anchors.top: parent.top
anchors.topMargin: Kirigami.Units.smallSpacing anchors.topMargin: Kirigami.Units.smallSpacing
anchors.right: root.right anchors.right: parent.right
anchors.rightMargin: root.rightAnchorMargin + Kirigami.Units.smallSpacing anchors.rightMargin: root.rightAnchorMargin + Kirigami.Units.smallSpacing
z: 10 z: 10
@@ -180,10 +185,6 @@ Item {
} }
} }
QQC2.ToolTip.text: root.display
QQC2.ToolTip.visible: hoverHandler.hovered
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
HoverHandler { HoverHandler {
id: hoverHandler id: hoverHandler
} }
@@ -214,6 +215,13 @@ Item {
} }
} }
} }
}
QQC2.ToolTip.text: root.display
QQC2.ToolTip.visible: hoverHandler.hovered
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
function downloadAndOpen() { function downloadAndOpen() {
if (_private.downloaded) { if (_private.downloaded) {