on xenial help sign in
Fix/Workaround first tab name not showing
commit98bb16051decc597e0a69899db7d3fce8bba75dc authorAlbert Astals <albert.astals@canonical.com> dateThu 13 Feb 2014, 13:24 (13 years ago) parentfa758b2
1 file changed+9−5
qml/Dash/DashContent.qml+9−5
qml/Dash/DashContent.qml+9−5
@@ -178,7 +178,11 @@ Item {
178178 selectionMode: false
179179 style: DashContentTabBarStyle {}
180180
181− model: dashContentList.model
181+ // TODO This together with the __styleInstance onModelChanged below
182+ // are a workaround for the first tab sometimes not showing the text.
183+ // But Tabs are going away in the future so not sure if makes
184+ // sense invetigating what's the problem at this stage
185+ model: dashContentList.model.count > 0 ? dashContentList.model : null
182186
183187 onSelectedIndexChanged: {
184188 dashContentList.currentIndex = selectedIndex;
@@ -192,10 +196,10 @@ Item {
192196 }
193197
194198 Connections {
195− target: model
196− onCountChanged: {
197− if (tabBar.selectedIndex < 0 && model.count > 0)
198− tabBar.selectedIndex = 0;
199+ target: __styleInstance
200+ onModelChanged: {
201+ tabBar.selectedIndex = -1;
202+ tabBar.selectedIndex = 0;
199203 }
200204 }
201205