From c5381c5194adf97c240acb98eb4c4c950633b325 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 4 Aug 2025 22:45:15 +1000 Subject: internal: refactor widgets folder Split into subdirs and rename to components --- components/images/CachingIconImage.qml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 components/images/CachingIconImage.qml (limited to 'components/images/CachingIconImage.qml') diff --git a/components/images/CachingIconImage.qml b/components/images/CachingIconImage.qml new file mode 100644 index 0000000..522a947 --- /dev/null +++ b/components/images/CachingIconImage.qml @@ -0,0 +1,31 @@ +import QtQuick + +Item { + property alias asynchronous: image.asynchronous + property alias status: image.status + property alias mipmap: image.mipmap + property alias backer: image + + property real implicitSize + readonly property real actualSize: Math.min(width, height) + + property url source + + onSourceChanged: { + if (source?.toString().startsWith("image://icon/")) + // Directly skip the path prop and treat like a normal Image component + image.source = source; + else if (source) + image.path = source; + } + + implicitWidth: implicitSize + implicitHeight: implicitSize + + CachingImage { + id: image + + anchors.fill: parent + fillMode: Image.PreserveAspectFit + } +} -- cgit v1.2.3-freya