window: Don't remove header widgets before changing panels
When changing panels, CcWindow can only remove the previous panel's header widgets after making sure the new panel was successfully set. However, this is not the case, and when the current panel fails to be set, the previous panel's header widget is removed. Fix that by waiting to remove the header widgets until the panel is successfully set.
Showing with 8 additions and 5 deletions