Adjusted text field size calculation to work better on OS X.