fix navbar #6250: classes is a global vs. local for each button

The `classes` variable inside the toolbar widget is only declared outside of the loop that assigns classes to each button. When looping over each button, this causes each button to "inherit" the classes assigned to the previous buttons. 

Fixes #6250