Layout improvements + various fixes

Hi Martial,
You switched to Qt, welcome to a new, better world !
This pull request fixes your layout to make it more dynamic. It also fixes a few obvious oddities in your code and refactor a few methods.
Enjoy !
Charles