diff options
author | Jens Bache-Wiig <jensbw@gmail.com> | 2011-09-29 09:52:06 +0200 |
---|---|---|
committer | Jens Bache-Wiig <jensbw@gmail.com> | 2011-09-29 09:52:28 +0200 |
commit | aa5ac41071fb43ef22f161a0c5be7a0da8413497 (patch) | |
tree | cea3990b3b00734d77ab72f3f774a4bca9bd1fbc | |
parent | 4d6b7c65823e77679778faf368ad6b2288cd8d83 (diff) | |
download | qtquickcontrols-aa5ac41071fb43ef22f161a0c5be7a0da8413497.tar.gz |
Fix multiple glitches with TableView rows
-rw-r--r-- | components/TableView.qml | 47 | ||||
-rw-r--r-- | components/ToolBar.qml | 4 |
2 files changed, 26 insertions, 25 deletions
diff --git a/components/TableView.qml b/components/TableView.qml index ade6a1d4..5d9734a8 100644 --- a/components/TableView.qml +++ b/components/TableView.qml @@ -67,6 +67,8 @@ FocusScope{ // Framewidth seems to be 1 regardless of style property int frameWidth: frame ? frameitem.frameWidth : 0; + width: 200 + height: 200 // Cosmetic properties property bool frame: true @@ -111,7 +113,7 @@ FocusScope{ Text { width: parent.width anchors.margins: 6 - + font.pixelSize:11 anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter elide: itemElideMode @@ -244,28 +246,6 @@ FocusScope{ scroller.blockUpdates = false; } - // Fills extra rows with alternate color - Column { - id: rowfiller - property variant rowHeight: Math.max(1, contentHeight / count) - property int rowCount: height/rowHeight - y: contentHeight - width: parent.width - visible: contentHeight > 0 && alternateRowColor && !verticalScrollBar.visible - height: parent.height - contentHeight - Repeater { - model: visible ? rowfiller.rowCount : 0 - StyleItem { - id: rowfill - elementType: "itemrow" - width: rowfiller.width - height: rowfiller.rowHeight - activeControl: (index + count) % 2 === 0 ? "alternate" : "" - } - } - - } - ListView { id: tree @@ -286,6 +266,27 @@ FocusScope{ focus: true clip: true + // Fills extra rows with alternate color + Column { + id: rowfiller + property variant rowHeight: Math.max(1, contentHeight / count) + property int rowCount: height/rowHeight + y: contentHeight + width: parent.width + visible: contentHeight > 0 && alternateRowColor && !verticalScrollBar.visible + height: parent.height - contentHeight + Repeater { + model: visible ? rowfiller.rowCount : 0 + StyleItem { + id: rowfill + elementType: "itemrow" + width: rowfiller.width + height: rowfiller.rowHeight + activeControl: (index + count) % 2 === 1 ? "alternate" : "" + } + } + } + Keys.onUpPressed: root.decrementCurrentIndex() Keys.onDownPressed: root.incrementCurrentIndex() diff --git a/components/ToolBar.qml b/components/ToolBar.qml index efdf973b..6eda98b7 100644 --- a/components/ToolBar.qml +++ b/components/ToolBar.qml @@ -2,10 +2,10 @@ import QtQuick 1.1 import "." import "custom" as Components -StyleItem{ +StyleItem { id: toolbar width: 200 - height: sizeFromContents(32, 32).height + height: 40 elementType: "toolbar" } |