issue #5057, refactor WidgetType to strong typed enum