store ui state on widget events