Fix positions of UI elements in NPC dialog

This PR should fix an issue #6277, but I don't see this bug in Windows/MSVC build at all, so I would ask someone who have this UI bug to test the PR.

P.S. Further work on UI of NPC dialog is strongly required.