From dd9f2665b1f84f0ba8ed21f5c47b532b2dc4db87 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 21 Jul 2015 16:55:12 +0200 Subject: Desktop/TreeViewStyle: Fix first column margin The margin was different depending on the item's depth resulting in an extra indentation for those items of depth zero. We fix this, and also set the proper inden- tation from the style. Change-Id: I8c9babd4b7c8b413f5c46cb756682eae4bf86892 Reviewed-by: Mitch Curtis --- src/controls/Styles/Desktop/TableViewStyle.qml | 2 +- src/controls/Styles/Desktop/TreeViewStyle.qml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/controls/Styles') diff --git a/src/controls/Styles/Desktop/TableViewStyle.qml b/src/controls/Styles/Desktop/TableViewStyle.qml index f5199f3f..88f41d7f 100644 --- a/src/controls/Styles/Desktop/TableViewStyle.qml +++ b/src/controls/Styles/Desktop/TableViewStyle.qml @@ -96,7 +96,7 @@ ScrollViewStyle { font: __styleitem.font anchors.left: parent.left anchors.right: parent.right - anchors.leftMargin: styleData["depth"] && styleData.column === 0 ? 0 : 8 + anchors.leftMargin: styleData.hasOwnProperty("depth") && styleData.column === 0 ? 0 : 8 horizontalAlignment: styleData.textAlignment anchors.verticalCenter: parent.verticalCenter elide: styleData.elideMode diff --git a/src/controls/Styles/Desktop/TreeViewStyle.qml b/src/controls/Styles/Desktop/TreeViewStyle.qml index 1901c40c..6424ed0e 100644 --- a/src/controls/Styles/Desktop/TreeViewStyle.qml +++ b/src/controls/Styles/Desktop/TreeViewStyle.qml @@ -56,12 +56,12 @@ Desktop.TableViewStyle { hasFocus: __styleitem.active Component.onCompleted: { - implicitWidth = si.pixelMetric("treeviewindentation") + root.__indentation = si.pixelMetric("treeviewindentation") + implicitWidth = root.__indentation implicitHeight = implicitWidth var rect = si.subControlRect("dummy"); width = rect.width height = rect.height - root.__indentation = width } } } -- cgit v1.2.1