When you double-click with the mouse on any part of the toolbar (on the area outside of the clickable buttons), the following dialog box appears. The actions are described below the picture.

The list on the left contains buttons that are not currently on the toolbar and available for adding. The list on the right contains the current toolbar buttons visible in the same order in which they are visible on the toolbar. The separator represents the vertical bar used to group related buttons. You can add/delete them as you wish. Once the customization is done they will be remembered for future use.