toolbar logic