finished moving common top toolbar code to toolbar.c