[Merge] lp:~rpadovani/webbrowser-app/newTabRefactoring into lp:webbrowser-app
Riccardo Padovani
riccardo at rpadovani.com
Sat Mar 14 16:37:59 UTC 2015
Ok, now should be ok.
Let me do a summary on this branch and on the new tab view, maybe there are better solutions of the one I thought.
So, designers want the behavior of the new tav view is like a listview with two sections, bookmarks and topsites.
The problem we have the model of bookmarks and of topsites are two different models.
A possible solution is to create a new model that is a merge of the others two, but could be have some problems, so I preferred to avoid this.
The solution already implemnented is to create a lisview with two delegate, a bookmark and a topsite.
Every delegate has another listview (or repeater) inside, with the related model.
The solution works well, but miss a the adding/removing of the section header when the last element is added/removed (as bug #1389605 reports).
My first thought was to use 'visible' element in the section header, but for some reason it doesn't work (at least on vivid). You can try just adding 'visible: false' in the section header.
So I choose to set height of the section header to 0 when there is nothing in the delegate, but I hit the upstream bug I reported in the comment above.
In the last commit I changed the approach: I add/remove section in the main listview when there aren't elements anymore.
I think this worsk well, but it doesn't scale well (if in a future we want to add a third section it's quite a mess) and the code is a bit ugly, but I haven't figured any better solution.
What do you think?
--
https://code.launchpad.net/~rpadovani/webbrowser-app/newTabRefactoring/+merge/247498
Your team Ubuntu Phablet Team is subscribed to branch lp:webbrowser-app.
More information about the Ubuntu-reviews
mailing list