summaryrefslogtreecommitdiff
path: root/share/qtcreator/qmldesigner/itemLibraryQmlSources
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-01-12 09:07:27 +0100
committerEike Ziller <eike.ziller@qt.io>2023-01-12 09:07:27 +0100
commit211d6507c338f63ebcf1ed58a3206c565bc6cb5c (patch)
treec1ba641cdb143b0f8696f847c7cc5834376e570c /share/qtcreator/qmldesigner/itemLibraryQmlSources
parent69a79010d6eecb9411385ba4000dd0d088963c54 (diff)
parenta61f8b02d30d2dfd8716e2ed7b7a23d287b68677 (diff)
downloadqt-creator-211d6507c338f63ebcf1ed58a3206c565bc6cb5c.tar.gz
Merge remote-tracking branch 'origin/qds/dev'
Conflicts: src/plugins/updateinfo/updateinfoplugin.cpp Change-Id: Ie1bf2ad434f0224fb91caf91b443daae3d5b5ec0
Diffstat (limited to 'share/qtcreator/qmldesigner/itemLibraryQmlSources')
-rw-r--r--share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetDelegate.qml34
1 files changed, 33 insertions, 1 deletions
diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetDelegate.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetDelegate.qml
index c717852649..1d5d2434c6 100644
--- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetDelegate.qml
+++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetDelegate.qml
@@ -182,9 +182,36 @@ TreeViewDelegate {
}
ToolTip {
+ id: assetTooltip
visible: !root.isFont && mouseArea.containsMouse && !root.assetsView.contextMenu.visible
- text: model.filePath
+ text: assetTooltip.__computeText()
delay: 1000
+
+ function __computeText()
+ {
+ let filePath = model.filePath.replace(assetsModel.contentDirPath(), "")
+ let fileSize = rootView.assetFileSize(model.filePath)
+ let fileExtMatches = model.filePath.match(/\.(.*)$/)
+ let fileExt = fileExtMatches ? "(" + fileExtMatches[1] + ")" : ""
+
+ if (rootView.assetIsImage(model.filePath)) {
+ let size = rootView.imageSize(model.filePath)
+
+ return filePath + "\n"
+ + size.width + " x " + size.height
+ + "\n" + fileSize
+ + " " + fileExt
+ } else {
+ return filePath + "\n"
+ + fileSize
+ + " " + fileExt
+ }
+ }
+
+ function refresh()
+ {
+ text = assetTooltip.__computeText()
+ }
}
Timer {
@@ -293,5 +320,10 @@ TreeViewDelegate {
: "image://qmldesigner_assets/" + model.filePath
}
+ onStatusChanged: {
+ if (thumbnailImage.status === Image.Ready)
+ assetTooltip.refresh()
+ }
+
} // Image
} // TreeViewDelegate