Re-organize panels only if Devtools is indeed docked to the right side.

Does what it says. Details in the commit message.

Idea taken from https://github.com/mauricelam/DockToRight. Hey, I'm new to this, so I hope stealing ideas / code from other open-source software isn't considered bad etiquette (is it?). If it is, please do tell me.