fix #40781: Visibility status of toolbar items not reflected in menu