From 998b0400afbb8b7f8510a28cd7d8a84ba02fed20 Mon Sep 17 00:00:00 2001 From: Shrief Gabr Date: Thu, 5 Dec 2024 23:50:23 +0200 Subject: [PATCH] QmlDesigner: Fix AssetsLibrary output logs Also did some modifications to the delegate's text and indicator margins. Fixes: QDS-10747 Change-Id: I700b0dd9d8843de47cccf058cd004e5da90761d2 Reviewed-by: Ali Kianian --- .../assetsLibraryQmlSources/AssetDelegate.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/qmldesigner/assetsLibraryQmlSources/AssetDelegate.qml b/share/qtcreator/qmldesigner/assetsLibraryQmlSources/AssetDelegate.qml index 01a739e2110..59d01e0f18f 100644 --- a/share/qtcreator/qmldesigner/assetsLibraryQmlSources/AssetDelegate.qml +++ b/share/qtcreator/qmldesigner/assetsLibraryQmlSources/AssetDelegate.qml @@ -2,12 +2,12 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import QtQuick -import QtQuick.Controls +import QtQuick.Templates as T import StudioTheme as StudioTheme import StudioControls as StudioControls import AssetsLibraryBackend -TreeViewDelegate { +T.TreeViewDelegate { id: root property StudioTheme.ControlStyle style: StudioTheme.Values.controlStyle @@ -36,8 +36,6 @@ TreeViewDelegate { implicitHeight: root.__isDirectory ? root.__dirItemHeight : root.__fileItemHeight implicitWidth: root.assetsView.width - leftMargin: root.__isDirectory ? 0 : thumbnailImage.width - Component.onCompleted: { // the depth of the root path will become available before we get to the actual // items we display, so it's safe to set assetsView.rootPathDepth here. All other @@ -83,9 +81,12 @@ TreeViewDelegate { } indicator: Item { - implicitWidth: 20 + id: arrowIndicator + + implicitWidth: 10 implicitHeight: root.implicitHeight anchors.left: bg.left + anchors.leftMargin: 5 Image { id: arrow @@ -126,11 +127,13 @@ TreeViewDelegate { contentItem: Text { id: assetLabel + text: assetLabel.__computeText() color: StudioTheme.Values.themeTextColor font.pixelSize: StudioTheme.Values.baseFontSize - anchors.verticalCenter: parent.verticalCenter verticalAlignment: Qt.AlignVCenter + anchors.left: root.__isDirectory ? arrowIndicator.right : thumbnailImage.right + anchors.leftMargin: 8 function __computeText() { return root.__isDirectory