diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-07-21 16:55:12 +0200 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-07-23 08:39:24 +0000 |
commit | dd9f2665b1f84f0ba8ed21f5c47b532b2dc4db87 (patch) | |
tree | e1b0c4ca1fce4afdf8165cb4bf0ad3a043514de1 /src/controls/Styles | |
parent | 6d679c4d2e376728180e579fb084f216a84028eb (diff) | |
download | qtquickcontrols-dd9f2665b1f84f0ba8ed21f5c47b532b2dc4db87.tar.gz |
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 <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/controls/Styles')
-rw-r--r-- | src/controls/Styles/Desktop/TableViewStyle.qml | 2 | ||||
-rw-r--r-- | src/controls/Styles/Desktop/TreeViewStyle.qml | 4 |
2 files changed, 3 insertions, 3 deletions
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 } } } |