@@ -17,6 +17,7 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Unity 0.2
20+import Utils 0.1
2021import "../Components"
2122
2223Item {
@@ -183,23 +184,30 @@ Item {
183184 width: parent.width
184185 style: DashContentTabBarStyle {}
185186
186− model: dashContentList.model
187+ SortFilterProxyModel {
188+ id: tabBarModel
187189
188− onSelectedIndexChanged: {
189− if (dashContentList.currentIndex == -1 && tabBar.selectedIndex != -1) {
190− // TODO This together with the Timer below
191− // are a workaround for the first tab sometimes not showing the text.
192− // But Tabs are going away in the future so not sure if makes
193− // sense invetigating what's the problem at this stage
194− selectionModeTimer.restart();
190+ model: dashContentList.model
191+
192+ property int selectedIndex: -1
193+ onSelectedIndexChanged: {
194+ if (dashContentList.currentIndex == -1 && tabBar.selectedIndex != -1) {
195+ // TODO This together with the Timer below
196+ // are a workaround for the first tab sometimes not showing the text.
197+ // But Tabs are going away in the future so not sure if makes
198+ // sense invetigating what's the problem at this stage
199+ selectionModeTimer.restart();
200+ }
201+ dashContentList.currentIndex = selectedIndex;
195202 }
196− dashContentList.currentIndex = selectedIndex;
197203 }
198204
205+ model: tabBarModel.count > 0 ? tabBarModel : null
206+
199207 Connections {
200208 target: dashContentList
201209 onCurrentIndexChanged: {
202− tabBar.selectedIndex = dashContentList.currentIndex
210+ tabBarModel.selectedIndex = dashContentList.currentIndex
203211 }
204212 }
205213