Also the preview state is now kept between panel loads. We also use a redraw function to update appearance based on the state.