Improves hover detail placement when space is tight

The layout error for hover detail elements is now checked for both
left and right alignment.  Then the alignment with the least error is
used.