make the dimension of config dialog change according to the size of current config options

I can't find a way to resize a WidgetContainer in runtime so when switching config options
new ConfigDialog is created with requested option panel.