Code review comment for lp:~zsombi/ubuntu-ui-toolkit/dynamic-tabs

Revision history for this message
Zsombor Egri (zsombi) wrote :

> 177 + if (tabs.selectedTabIndex >= index) {
> 178 + // move the selected index to the next index
> 179 + tabs.selectedTabIndex += 1;
> 180 + } else {
> 181 + tabs.modelChanged();
> 182 + }
>
> Why is modelChanged inside the else { }? Should it not be outside? The model
> also changed if selectedTabIndex < index.
When you change the selectedTabIndex, the visuals are automatically updated and will point to the proper tab. However if the selected tab stays at the same index, but the model content is changed, PathView scrolls the content away and there will be nothing shown in the TabBar. Thus need to refresh the visuals by calling that signal (I'm removing that signal and substing with a sync() function)

« Back to merge proposal