From fd4d1f08fa18327c94fd8046981a865610aed399 Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Thu, 1 Dec 2022 14:13:33 +0200 Subject: QmlDesigner: Add a tooltip to material browser textures Change-Id: I5a2dd41602bb03357fdd1b7280242f6ea43ff56f Reviewed-by: Miikka Heikkinen --- .../qmldesigner/materialBrowserQmlSource/TextureItem.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml index 19762299c6d..3492a1dfef3 100644 --- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml +++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0 import QtQuick +import QtQuick.Controls import QtQuick.Layouts import QtQuickDesignerTheme import HelperWidgets @@ -26,6 +27,7 @@ Rectangle { anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton + hoverEnabled: true onPressed: (mouse) => { rootView.focusMaterialSection(false) @@ -40,6 +42,14 @@ Rectangle { onDoubleClicked: materialBrowserTexturesModel.openTextureEditor(); } + ToolTip { + property bool hasSource: textureSource.slice(-1) !== "/" + + visible: mouseArea.containsMouse + text: hasSource ? textureSource : qsTr("Texture has no source image.") + delay: 1000 + } + Image { source: "image://materialBrowserTex/" + textureSource asynchronous: true -- cgit v1.2.3