Commit 5eb54a1a authored by Jens Bache-Wiig's avatar Jens Bache-Wiig Committed by The Qt Project
Browse files

Fixed incorrect size hints for TableView


This ensures that double click to adjust content size on
headers doesn't end up eliding text. We also added
significantly more space by default.

Change-Id: I05a05649a41ef4b70ee839195a87c684786760b1
Reviewed-by: default avatarJ-P Nurmi <jpnurmi@digia.com>
Reviewed-by: default avatarGabriel de Dietrich <gabriel.dedietrich@digia.com>
parent eb7cb933
6.2 5.10 5.11 5.12 5.12.1 5.12.10 5.12.11 5.12.12 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.13 5.13.0 5.13.1 5.13.2 5.14 5.14.0 5.14.1 5.14.2 5.15 5.15.0 5.15.1 5.15.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.9.8 dev old/5.1 old/5.2 wip/calendar wip/tizen v5.15.0-alpha1 v5.14.1 v5.14.0 v5.14.0-rc2 v5.14.0-rc1 v5.14.0-beta3 v5.14.0-beta2 v5.14.0-beta1 v5.14.0-alpha1 v5.13.2 v5.13.1 v5.13.0 v5.13.0-rc3 v5.13.0-rc2 v5.13.0-rc1 v5.13.0-beta4 v5.13.0-beta3 v5.13.0-beta2 v5.13.0-beta1 v5.13.0-alpha1 v5.12.7 v5.12.6 v5.12.5 v5.12.4 v5.12.3 v5.12.2 v5.12.1 v5.12.0 v5.12.0-rc2 v5.12.0-rc1 v5.12.0-beta4 v5.12.0-beta3 v5.12.0-beta2 v5.12.0-beta1 v5.12.0-alpha1 v5.11.3 v5.11.2 v5.11.1 v5.11.0 v5.11.0-rc2 v5.11.0-rc1 v5.11.0-beta4 v5.11.0-beta3 v5.11.0-beta2 v5.11.0-beta1 v5.11.0-alpha1 v5.10.1 v5.10.0 v5.10.0-rc3 v5.10.0-rc2 v5.10.0-rc1 v5.10.0-beta4 v5.10.0-beta3 v5.10.0-beta2 v5.10.0-beta1 v5.10.0-alpha1 v5.9.9 v5.9.8 v5.9.7 v5.9.6 v5.9.5 v5.9.4 v5.9.3 v5.9.2 v5.9.1 v5.9.0 v5.9.0-rc2 v5.9.0-rc1 v5.9.0-beta4 v5.9.0-beta3 v5.9.0-beta2 v5.9.0-beta1 v5.9.0-alpha1 v5.8.0 v5.8.0-rc1 v5.8.0-beta1 v5.8.0-alpha1 v5.7.1 v5.7.0 v5.7.0-rc1 v5.7.0-beta1 v5.7.0-alpha1 v5.6.3 v5.6.2 v5.6.1 v5.6.1-1 v5.6.0 v5.6.0-rc1 v5.6.0-beta1 v5.6.0-alpha1 v5.5.1 v5.5.0 v5.5.0-rc1 v5.5.0-beta1 v5.5.0-alpha1 v5.4.2 v5.4.1 v5.4.0 v5.4.0-rc1 v5.4.0-beta1 v5.4.0-alpha1 v5.3.2 v5.3.1 v5.3.0 v5.3.0-rc1 v5.3.0-beta1 v5.3.0-alpha1 v5.2.1 v5.2.0 v5.2.0-rc1 v5.2.0-beta1 v5.2.0-alpha1 v5.1.1 v5.1.0 v5.1.0-rc2 v5.1.0-rc1
No related merge requests found
Showing with 7 additions and 7 deletions
...@@ -75,8 +75,9 @@ ScrollViewStyle { ...@@ -75,8 +75,9 @@ ScrollViewStyle {
anchors.fill: parent anchors.fill: parent
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
anchors.leftMargin: 4 anchors.leftMargin: 12
text: styleData.value text: styleData.value
elide: Text.ElideRight
color: textColor color: textColor
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
...@@ -92,8 +93,7 @@ ScrollViewStyle { ...@@ -92,8 +93,7 @@ ScrollViewStyle {
/* Delegate for header. This delegate is described in \l TableView::rowDelegate */ /* Delegate for header. This delegate is described in \l TableView::rowDelegate */
property Component rowDelegate: Rectangle { property Component rowDelegate: Rectangle {
implicitHeight: 20 height: 20
implicitWidth: 80
property color selectedColor: styleData.hasActiveFocus ? "#38d" : "#999" property color selectedColor: styleData.hasActiveFocus ? "#38d" : "#999"
gradient: Gradient { gradient: Gradient {
GradientStop { color: styleData.selected ? Qt.lighter(selectedColor, 1.3) : styleData.alternate ? "#f2f2f2" : "white" ; position: 0 } GradientStop { color: styleData.selected ? Qt.lighter(selectedColor, 1.3) : styleData.alternate ? "#f2f2f2" : "white" ; position: 0 }
...@@ -115,13 +115,13 @@ ScrollViewStyle { ...@@ -115,13 +115,13 @@ ScrollViewStyle {
/* Delegate for header. This delegate is described in \l TableView::itemDelegate */ /* Delegate for header. This delegate is described in \l TableView::itemDelegate */
property Component itemDelegate: Item { property Component itemDelegate: Item {
height: Math.max(16, label.implicitHeight) height: Math.max(16, label.implicitHeight)
property int implicitWidth: sizehint.paintedWidth + 4 property int implicitWidth: sizehint.paintedWidth + 20
Text { Text {
id: label id: label
objectName: "label" objectName: "label"
width: parent.width width: parent.width
anchors.margins: 6 anchors.leftMargin: 12
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
horizontalAlignment: styleData.textAlignment horizontalAlignment: styleData.textAlignment
......
...@@ -86,13 +86,13 @@ ScrollViewStyle { ...@@ -86,13 +86,13 @@ ScrollViewStyle {
property Component itemDelegate: Item { property Component itemDelegate: Item {
height: Math.max(16, label.implicitHeight) height: Math.max(16, label.implicitHeight)
property int implicitWidth: sizehint.paintedWidth + 4 property int implicitWidth: sizehint.paintedWidth + 16
Text { Text {
id: label id: label
objectName: "label" objectName: "label"
width: parent.width width: parent.width
anchors.margins: 6 anchors.leftMargin: 8
font: __styleitem.font font: __styleitem.font
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment