diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-03-03 13:49:27 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-03-03 14:37:14 +0200 |
commit | b2e4f1485df801a9e7f3812a66e4e7fc6c578980 (patch) | |
tree | 4f47c7a24a3a0896136aff477144aa6c9d87d15c /examples/datavisualization/qmllegend/qml/qmllegend/main.qml | |
parent | 7206dc36f1be77515cf6759795b265c986b2e20b (diff) |
Enable querying shadow support from graphs
Also some example tweaking.
Change-Id: If69e9d3617afc37b88fed4fd0e02ae19f0af7f78
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'examples/datavisualization/qmllegend/qml/qmllegend/main.qml')
-rw-r--r-- | examples/datavisualization/qmllegend/qml/qmllegend/main.qml | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/examples/datavisualization/qmllegend/qml/qmllegend/main.qml b/examples/datavisualization/qmllegend/qml/qmllegend/main.qml index 6999a67b..f7e2d803 100644 --- a/examples/datavisualization/qmllegend/qml/qmllegend/main.qml +++ b/examples/datavisualization/qmllegend/qml/qmllegend/main.qml @@ -45,10 +45,7 @@ Rectangle { Item { id: dataView - anchors.top: buttonLayout.bottom - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right + anchors.fill: parent Bars3D { id: barGraph @@ -99,12 +96,18 @@ Rectangle { Rectangle { property int legendLocation: 3 + // Make the height and width fractional of main view height and width. + // Reverse the relation if screen is in portrait - this makes legend look the same + // if the orientation is rotated. + property int fractionalHeight: mainView.width > mainView.height ? mainView.height / 5 : mainView.width / 5 + property int fractionalWidth: mainView.width > mainView.height ? mainView.width / 5 : mainView.height / 5 id: legendPanel - width: 200 - height: 100 + width: fractionalWidth > 150 ? fractionalWidth : 150 + // Adjust legendpanel height to avoid gaps between layouted items. + height: fractionalHeight > 99 ? fractionalHeight - fractionalHeight % 3 : 99 border.color: barGraph.theme.labelTextColor - border.width: 2 + border.width: 3 color: "#00000000" // Transparent //! [0] @@ -152,7 +155,7 @@ Rectangle { when: legendPanel.legendLocation === 1 AnchorChanges { target: legendPanel - anchors.top: dataView.top + anchors.top: buttonLayout.bottom anchors.bottom: undefined anchors.left: dataView.left anchors.right: undefined @@ -163,7 +166,7 @@ Rectangle { when: legendPanel.legendLocation === 2 AnchorChanges { target: legendPanel - anchors.top: dataView.top + anchors.top: buttonLayout.bottom anchors.bottom: undefined anchors.left: undefined anchors.right: dataView.right |