Refactor resizing.

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Merge pull request #124 from GordonSmith/ResizeWidget

Refactor resizing.