Present Windows TabBox Layout + key navigation in TabBox
Review Request #104357 - Created March 21, 2012 and submitted
This is a multi commit review request (yes I'm also lazy;-) @Aurélien: I added you to the request as you recently had shown interest in the QML switchers. So any comments on this new layout are appreciated. I consider this layout as a good replacement for the old box-switch effect showing all thumbnails but just in a much better way. And I am thinking about whether this could be a good default. Present Windows like Window Switcher layout This layout is intended to replace the TabBox mode in Present Windows effect. The advantages of a layout over the effect are: * works without compositing * supports multi-screen in a better way (windows don't move) * is an overlay on top of the windows instead of reusing the windows * is not a hack inside the actual effect * visually consistent with other layouts Add proper key navigation to layout based window switchers The grabbed key events inside TabBox are forwarded to the declarative view which passes it to the normal keyPressedEvent() method. This allows the QML files to handle keyboard navigation themselves. The views support key navigation natively, though this cannot be used as we need to update the ModelIndex when a new item is selected. Also there seems to be a problem if the tabbox is shown again, in that case the focus seems to be somehow lost. Because of that the navigation is handled in the Item embedding the list.
(Thanks for adding me to the reviewers) It looks good, but I think the text and icon part can be improved a bit: Similar to the changes I suggest in the compat layout merge request, I think all icons should be colored, and bold should only be used for the text of the selected window. The icon and the text are too far from each other. You could either: a) Move the icon to the left of the text b) Align the left of the icon with the left of the thumbnail and move the text to the right of the icon I think a) would look nicer, but it needs to be tried.
Review request changed
Updated the layout to match proposal a: * no longer bold text * icon grouped with text I decided to not use any bold text as bold text made the text and icon jump around when the item got selected. Proposal b is hard to impossible to implement as I don't know in the layout where the borders of the thumbnail will be rendered.