@@ -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 {
@@ -188,23 +189,30 @@ Item {
188189 width: parent.width
189190 style: DashContentTabBarStyle {}
190191
191− model: dashContentList.model
192+ SortFilterProxyModel {
193+ id: tabBarModel
192194
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();
195+ model: dashContentList.model
196+
197+ property int selectedIndex: -1
198+ onSelectedIndexChanged: {
199+ if (dashContentList.currentIndex == -1 && tabBar.selectedIndex != -1) {
200+ // TODO This together with the Timer below
201+ // are a workaround for the first tab sometimes not showing the text.
202+ // But Tabs are going away in the future so not sure if makes
203+ // sense invetigating what's the problem at this stage
204+ selectionModeTimer.restart();
205+ }
206+ dashContentList.currentIndex = selectedIndex;
200207 }
201− dashContentList.currentIndex = selectedIndex;
202208 }
203209
210+ model: tabBarModel.count > 0 ? tabBarModel : null
211+
204212 Connections {
205213 target: dashContentList
206214 onCurrentIndexChanged: {
207− tabBar.selectedIndex = dashContentList.currentIndex
215+ tabBarModel.selectedIndex = dashContentList.currentIndex
208216 }
209217 }
210218