Brought back auto-aligning dropdown if it stretches outside of the viewp...

...ort and no align is given, broken in d9a5a7c, fixes #4619

I've bisected the code and found, that bug 4619 first appeared in d9a5a7c.

I've tried to merge two functionalities - choosing align manually and having auto-align by default.