Adjust the tabindices in the viewer

The current way that the tabindices are defined, has the unfortunate consequence that adding a single button to the UI might mean having to change almost all tabindices. (This was the case in e.g. PR 4329.)

This patch attempts to avoid that situation happening again, by re-defining the tabindices slightly.
Merge pull request #5062 from Snuffleupagus/adjusted-viewer-tabindices

Adjust the tabindices in the viewer