@@ -46,7 +46,7 @@ IndicatorTest {
4646 IndicatorsBar {
4747 id: indicatorsBar
4848 height: expanded ? units.gu(7) : units.gu(3)
49− width: units.gu(30)
49+ width: units.gu(widthSlider.value)
5050 anchors.centerIn: parent
5151 indicatorsModel: root.indicatorsModel
5252 interactive: expanded && height === units.gu(7)
@@ -79,6 +79,14 @@ IndicatorTest {
7979 onClicked: indicatorsBar.expanded = !indicatorsBar.expanded
8080 }
8181
82+ Slider {
83+ id: widthSlider
84+ Layout.fillWidth: true
85+ minimumValue: 10
86+ maximumValue: 60
87+ value: 30
88+ }
89+
8290 Rectangle {
8391 Layout.preferredHeight: units.dp(1);
8492 Layout.fillWidth: true;
@@ -114,6 +122,7 @@ IndicatorTest {
114122 when: windowShown
115123
116124 function init() {
125+ widthSlider.value = 30;
117126 indicatorsBar.expanded = false;
118127 wait_for_expansion_to_settle();
119128 }
@@ -220,5 +229,21 @@ IndicatorTest {
220229 tryCompareFunction(function() { return dataItem.width > 0.0; }, true);
221230 }
222231 }
232+
233+ // Rough test that resizing the IndicatorsBar has the items reposition correctly
234+ function test_widthChangeRepositionsItems() {
235+ var lastItemIndex = root.originalModelData.length-1;
236+ var dataItem = findChild(indicatorsBar, root.originalModelData[lastItemIndex]["identifier"] + "-panelItem");
237+ verify(dataItem !== null);
238+
239+ var mappedPosition = indicatorsBar.mapFromItem(dataItem, dataItem.width/2, dataItem.height/2);
240+ var oldDistanceFromRightEdge = indicatorsBar.width - mappedPosition.x;
241+
242+ widthSlider.value = 50;
243+ mappedPosition = indicatorsBar.mapFromItem(dataItem, dataItem.width/2, dataItem.height/2);
244+ var newDistanceFromRightEdge = indicatorsBar.width - mappedPosition.x;
245+
246+ compare(newDistanceFromRightEdge, oldDistanceFromRightEdge);
247+ }
223248 }
224249}