Comment 4 for bug 1513933

Revision history for this message
Tim Peeters (tpeeters) wrote :

I implemented the desired behavior in the attached MR. However, that conflicts with this bug: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1511839

Internally, the application header has a single Sections instance, and when the active Page changes, the PageHeadSections of that Page becomes active and updates the model of the Sections. That will reset the selectedIndex to 0. This is not a new problem with the new PageHeader, because each Page has its own PageHeader, but with the old PageHeadConfiguration and PageHeadSections the index must be reset to 0 with this behavior.

The solution is to use an old version of Sections in the (old) application header (configured with Page.head), and to use the new Sections with PageHeader. The new Sections (use PageHeader) always works as desired, but when using the Page.head.sections, the index is not reset to 0 when changing the model. So applications that change the model and require this behavior need to update the app to make use of the PageHeader (or implement a workaround where the app sets the new selectedIndex for Page.head.sections after the model is updated).