forked from qt-creator/qt-creator
Fixes: QDS-8058 Fixes: QDS-8059 Change-Id: I1adfdc7ac15141e010467813ec6e673060269241 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
35 lines
856 B
QML
35 lines
856 B
QML
// Copyright (C) 2022 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
|
|
|
import QtQuick 2.15
|
|
import QtQuick.Layouts 1.15
|
|
import QtQuickDesignerTheme 1.0
|
|
import HelperWidgets 2.0
|
|
import QtQuick.Controls
|
|
|
|
import StudioTheme 1.0 as StudioTheme
|
|
|
|
Image {
|
|
id: root
|
|
|
|
source: modelData.textureIcon
|
|
visible: modelData.textureVisible
|
|
cache: false
|
|
|
|
signal showContextMenu()
|
|
|
|
MouseArea {
|
|
id: mouseArea
|
|
|
|
anchors.fill: parent
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
|
|
onPressed: (mouse) => {
|
|
if (mouse.button === Qt.LeftButton)
|
|
rootView.startDragTexture(modelData, mapToGlobal(mouse.x, mouse.y))
|
|
else if (mouse.button === Qt.RightButton)
|
|
root.showContextMenu()
|
|
}
|
|
}
|
|
}
|