Warning, /plasma/plasma-workspace/applets/clipboard/contents/ui/ImageItemDelegate.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org> 0003 SPDX-FileCopyrightText: 2014 Sebastian Kügler <sebas@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 import QtQuick 2.15 0009 0010 import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons 0011 import org.kde.kirigami 2.20 as Kirigami 0012 0013 Item { 0014 height: childrenRect.height 0015 0016 Drag.active: dragHandler.active 0017 Drag.dragType: Drag.Automatic 0018 Drag.supportedActions: Qt.CopyAction 0019 Drag.mimeData: { 0020 "image/png": DecorationRole, 0021 } 0022 0023 KQuickControlsAddons.QImageItem { 0024 id: previewImage 0025 0026 width: Math.min(Math.round(height * nativeWidth/nativeHeight), parent.width) 0027 height: Math.min(nativeHeight, Kirigami.Units.gridUnit * 4 + Kirigami.Units.smallSpacing * 2) 0028 0029 // align left 0030 // right in RTL 0031 anchors.left: parent.left 0032 0033 image: DecorationRole 0034 smooth: true 0035 fillMode: Image.PreserveAspectFit 0036 } 0037 }