forked from qt-creator/qt-creator
QmlDesigner: Fix the right margin for the AssetsView
Task-number: QDS-8352 Change-Id: If08cf7c39cea9dde8e241214c775685b4b1fd4f8 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -26,7 +26,12 @@ TreeViewDelegate {
|
|||||||
readonly property int __dirItemHeight: 21
|
readonly property int __dirItemHeight: 21
|
||||||
|
|
||||||
implicitHeight: root.__isDirectory ? root.__dirItemHeight : root.__fileItemHeight
|
implicitHeight: root.__isDirectory ? root.__dirItemHeight : root.__fileItemHeight
|
||||||
implicitWidth: root.assetsView.width > 0 ? root.assetsView.width : 10
|
implicitWidth: {
|
||||||
|
if (root.assetsView.verticalScrollBar.scrollBarVisible)
|
||||||
|
return root.assetsView.width - root.indentation - root.assetsView.verticalScrollBar.width
|
||||||
|
else
|
||||||
|
return root.assetsView.width - root.indentation
|
||||||
|
}
|
||||||
|
|
||||||
leftMargin: root.__isDirectory ? 0 : thumbnailImage.width
|
leftMargin: root.__isDirectory ? 0 : thumbnailImage.width
|
||||||
|
|
||||||
@@ -54,17 +59,6 @@ TreeViewDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onImplicitWidthChanged: {
|
|
||||||
// a small hack, to fix a glitch: when resizing the width of the tree view,
|
|
||||||
// the widths of the delegate items remain the same as before, unless we re-set
|
|
||||||
// that width explicitly.
|
|
||||||
var newWidth = root.implicitWidth - (root.assetsView.verticalScrollBar.scrollBarVisible
|
|
||||||
? root.assetsView.verticalScrollBar.width
|
|
||||||
: 0)
|
|
||||||
bg.width = newWidth
|
|
||||||
bg.implicitWidth = newWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
onDepthChanged: {
|
onDepthChanged: {
|
||||||
if (root.depth > root.initialDepth && root.initialDepth >= 0)
|
if (root.depth > root.initialDepth && root.initialDepth >= 0)
|
||||||
root.depth = root.initialDepth
|
root.depth = root.initialDepth
|
||||||
@@ -73,6 +67,8 @@ TreeViewDelegate {
|
|||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
id: bg
|
id: bg
|
||||||
|
|
||||||
|
width: root.implicitWidth
|
||||||
|
|
||||||
color: {
|
color: {
|
||||||
if (root.__isDirectory && (root.isHighlighted || root.hasChildWithDropHover))
|
if (root.__isDirectory && (root.isHighlighted || root.hasChildWithDropHover))
|
||||||
return StudioTheme.Values.themeInteraction
|
return StudioTheme.Values.themeInteraction
|
||||||
|
Reference in New Issue
Block a user