diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2022-12-01 14:13:33 +0200 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2022-12-01 13:44:20 +0000 |
commit | fd4d1f08fa18327c94fd8046981a865610aed399 (patch) | |
tree | 4fa839d97faa2c994841c3f243c8a0bd815d202c | |
parent | 5f7d36d1cbd80444cf00907e2f64b535747ea943 (diff) |
QmlDesigner: Add a tooltip to material browser textures
Change-Id: I5a2dd41602bb03357fdd1b7280242f6ea43ff56f
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml index 19762299c6..3492a1dfef 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 |