Select the menu width automatically

A follow-up to https://phabricator.wikimedia.org/T76196 .
Simplify getMenuWidth()
Merge pull request #170 from amire80/auto-width

Select the menu width automatically