Compare commits

...

2 Commits

Author SHA1 Message Date
Darshan Phaldesai
43bde4c9d2 ImageComponent: add a parent Item to anchor everything to 2026-02-25 18:17:37 -07:00
Darshan Phaldesai
cab57cc656 ImageComponent: make the image left aligned again. makes it work
properly for CompactLayout
2026-02-25 17:36:06 -07:00

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
@@ -147,7 +152,9 @@ Item {
Loader { Loader {
id: imageLoader id: imageLoader
anchors.fill: parent anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
active: !root.componentAttributes.animated && !_private.hideImage active: !root.componentAttributes.animated && !_private.hideImage
sourceComponent: Image { sourceComponent: Image {
@@ -163,7 +170,9 @@ Item {
Loader { Loader {
id: animatedImageLoader id: animatedImageLoader
anchors.fill: parent anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
active: (root?.componentAttributes.animated ?? false) && !_private.hideImage active: (root?.componentAttributes.animated ?? false) && !_private.hideImage
sourceComponent: AnimatedImage { sourceComponent: AnimatedImage {
@@ -176,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
} }
@@ -210,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) {