vls-lab/inselect — pull request #31 by aliceh75 (2014-09-09 10:42:46+00:00)
Title: Implement key-based navigation

Some notes:

- Navigation is done with previous/next navigation (keys: p/n). This more or less follows rows across the image, starting in the top left corner (the sidebar items have been adjusted to be in the same order). Navigation using cursor keys is not a trivial problem (in particular to ensure all boxes are attainable), and we agreed this was good enough for now;

- For users I thought it made more sense to move the bottom right and top left corners individually (rather than 'resize' the box), as that makes it easier to get the selection right. Bottom right uses shift + cursor keys, while top left uses Control + cursor keys. Might not be the best combination, but we thought we would do it this way and wait for user feedback;

- I added the key handling at the GraphicsView level. I think this definitely makes sense for the navigate/resize keys. Possibly zoom-to-selection (and delete) could be moved at the QMainWindow level, but I thought it fitted better there;

- I removed the numbered labels from the sidebar. The items are sorted on add to make prev/next navigation easy. To keep the labels as growing integers would require updating them all when new items are added. I assumed that once we had annotations these would replace the label anyway.

Available navigation:

p: Previous item
n: Next item
Cursor keys: Move current selection
Shift + Cursor keys: move bottom right corner(s) of current selection
Control + Cursor keys: move top left corner(s) of current selection
z: Zoom to current selection

Additional feature is that the view follows the selection (so pressing n/p - or selecting an item in the sidebar - will cause that box to come into view if it isn't)