Add repaint of main panel after mouse button is released and fix bg-colour