@@ -163,51 +163,24 @@ Item {
163163 objectName: "tabbar"
164164 height: units.gu(7)
165165 width: parent.width
166− implicitWidth: currentButtonWidth
166+ implicitWidth: 400
167167
168− property alias selectedTabIndex: tabs.selectedTabIndex
168+ model: dashContentList.model
169169
170− Component.onCompleted: {
171− __styleInstance.headerTextStyle = Text.Raised
172− __styleInstance.headerTextStyleColor = "black"
170+ onSelectedIndexChanged: {
171+ dashContentList.currentIndex = selectedIndex;
173172 }
174173
175− tabsItem: TabsBase {
176− id: tabs
177−
178− Repeater {
179− model: dashContentList.model
180− Tab {
181− id: tab
182− title: scope.name
183− Component.onCompleted: {
184− var aux = tabs.tabList;
185− aux.push(tab)
186− tabs.tabList = aux;
187− tabs.modelChanged();
188− if (tabs.selectedTabIndex == -1) {
189− tabs.selectedTabIndex = 0;
190− }
191− }
192− Component.onDestruction: {
193− var aux = tabs.tabList;
194− aux.splice(aux.indexOf(tab), 1)
195− tabs.tabList = aux;
196− tabs.modelChanged();
197− }
198− }
199− }
200−
201− onSelectedTabIndexChanged: {
202− dashContentList.currentIndex = selectedTabIndex;
174+ Connections {
175+ target: dashContentList
176+ onCurrentIndexChanged: {
177+ tabbar.selectedIndex = dashContentList.currentIndex
203178 }
179+ }
204180
205− Connections {
206− target: dashContentList
207− onCurrentIndexChanged: {
208− tabs.selectedTabIndex = dashContentList.currentIndex
209− }
210− }
181+ Component.onCompleted: {
182+ __styleInstance.headerTextStyle = Text.Raised
183+ __styleInstance.headerTextStyleColor = "black"
211184 }
212185 }
213186 }