Backporting the work from 2013 to make widgets resizable.