summaryrefslogtreecommitdiff
path: root/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml
diff options
context:
space:
mode:
Diffstat (limited to 'share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml')
-rw-r--r--share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml20
1 files changed, 11 insertions, 9 deletions
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml
index 002fcb0d7d..99970bc266 100644
--- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml
+++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml
@@ -7,6 +7,7 @@ import QtQuick.Layouts
import QtQuickDesignerTheme
import HelperWidgets
import StudioTheme as StudioTheme
+import MaterialBrowserBackend
Rectangle {
id: root
@@ -14,9 +15,9 @@ Rectangle {
visible: textureVisible
color: "transparent"
- border.width: materialBrowserTexturesModel.selectedIndex === index
- ? !rootView.materialSectionFocused ? 3 : 1 : 0
- border.color: materialBrowserTexturesModel.selectedIndex === index
+ border.width: MaterialBrowserBackend.materialBrowserTexturesModel.selectedIndex === index
+ ? !MaterialBrowserBackend.rootView.materialSectionFocused ? 3 : 1 : 0
+ border.color: MaterialBrowserBackend.materialBrowserTexturesModel.selectedIndex === index
? StudioTheme.Values.themeControlOutlineInteraction
: "transparent"
@@ -30,16 +31,16 @@ Rectangle {
hoverEnabled: true
onPressed: (mouse) => {
- rootView.focusMaterialSection(false)
- materialBrowserTexturesModel.selectTexture(index)
+ MaterialBrowserBackend.materialBrowserTexturesModel.selectTexture(index)
+ MaterialBrowserBackend.rootView.focusMaterialSection(false)
if (mouse.button === Qt.LeftButton)
- rootView.startDragTexture(index, mapToGlobal(mouse.x, mouse.y))
+ MaterialBrowserBackend.rootView.startDragTexture(index, mapToGlobal(mouse.x, mouse.y))
else if (mouse.button === Qt.RightButton)
root.showContextMenu()
}
- onDoubleClicked: materialBrowserTexturesModel.openTextureEditor();
+ onDoubleClicked: MaterialBrowserBackend.materialBrowserTexturesModel.openTextureEditor();
}
ToolTip {
@@ -61,9 +62,10 @@ Rectangle {
Image {
source: "image://materialBrowserTex/" + textureSource
asynchronous: true
- sourceSize.width: root.width - 10
- sourceSize.height: root.height - 10
+ width: root.width - 10
+ height: root.height - 10
anchors.centerIn: parent
smooth: true
+ fillMode: Image.PreserveAspectFit
}
}