forked from qt-creator/qt-creator
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 <ali.kianian@qt.io>
This commit is contained in:
@@ -2,12 +2,12 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Templates as T
|
||||||
import StudioTheme as StudioTheme
|
import StudioTheme as StudioTheme
|
||||||
import StudioControls as StudioControls
|
import StudioControls as StudioControls
|
||||||
import AssetsLibraryBackend
|
import AssetsLibraryBackend
|
||||||
|
|
||||||
TreeViewDelegate {
|
T.TreeViewDelegate {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property StudioTheme.ControlStyle style: StudioTheme.Values.controlStyle
|
property StudioTheme.ControlStyle style: StudioTheme.Values.controlStyle
|
||||||
@@ -36,8 +36,6 @@ TreeViewDelegate {
|
|||||||
implicitHeight: root.__isDirectory ? root.__dirItemHeight : root.__fileItemHeight
|
implicitHeight: root.__isDirectory ? root.__dirItemHeight : root.__fileItemHeight
|
||||||
implicitWidth: root.assetsView.width
|
implicitWidth: root.assetsView.width
|
||||||
|
|
||||||
leftMargin: root.__isDirectory ? 0 : thumbnailImage.width
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// the depth of the root path will become available before we get to the actual
|
// 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
|
// items we display, so it's safe to set assetsView.rootPathDepth here. All other
|
||||||
@@ -83,9 +81,12 @@ TreeViewDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
indicator: Item {
|
indicator: Item {
|
||||||
implicitWidth: 20
|
id: arrowIndicator
|
||||||
|
|
||||||
|
implicitWidth: 10
|
||||||
implicitHeight: root.implicitHeight
|
implicitHeight: root.implicitHeight
|
||||||
anchors.left: bg.left
|
anchors.left: bg.left
|
||||||
|
anchors.leftMargin: 5
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: arrow
|
id: arrow
|
||||||
@@ -126,11 +127,13 @@ TreeViewDelegate {
|
|||||||
|
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
id: assetLabel
|
id: assetLabel
|
||||||
|
|
||||||
text: assetLabel.__computeText()
|
text: assetLabel.__computeText()
|
||||||
color: StudioTheme.Values.themeTextColor
|
color: StudioTheme.Values.themeTextColor
|
||||||
font.pixelSize: StudioTheme.Values.baseFontSize
|
font.pixelSize: StudioTheme.Values.baseFontSize
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
anchors.left: root.__isDirectory ? arrowIndicator.right : thumbnailImage.right
|
||||||
|
anchors.leftMargin: 8
|
||||||
|
|
||||||
function __computeText() {
|
function __computeText() {
|
||||||
return root.__isDirectory
|
return root.__isDirectory
|
||||||
|
Reference in New Issue
Block a user