keep panelVisible flag in sync with panel hide/show