update BoxWidget to support 4 layout directions