private void createTitlePanelToolbar(@NotNull String dimensionKey) {
    ActionGroup actionGroup = new LightActionGroup() {
      @Override
      public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) {
        return myToolbarActions.toArray(AnAction.EMPTY_ARRAY);
      }
    };
    AnAction restoreSizeButton =
      new DumbAwareAction(DvcsBundle.messagePointer("action.BranchActionGroupPopup.Anonymous.text.restore.size"), FitContent) {
        @Override
        public void actionPerformed(@NotNull AnActionEvent e) {
          WindowStateService.getInstance(myProject).putSizeFor(myProject, dimensionKey, null);
          myInternalSizeChanged = true;
          pack(true, true);
        }

        @Override
        public @NotNull ActionUpdateThread getActionUpdateThread() {
          return ActionUpdateThread.EDT;
        }

        @Override
        public void update(@NotNull AnActionEvent e) {
          e.getPresentation().setEnabled(myUserSizeChanged);
        }
      };
    ActionGroup settingsGroup = new ActionGroup(DvcsBundle.message("action.BranchActionGroupPopup.settings.text"), true) {
      @Override
      public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) {
        return mySettingsActions.toArray(AnAction.EMPTY_ARRAY);
      }
    };
    settingsGroup.getTemplatePresentation().setHideGroupIfEmpty(true);
    settingsGroup.getTemplatePresentation().setIcon(AllIcons.General.GearPlain);

    myToolbarActions.add(restoreSizeButton);
    myToolbarActions.add(settingsGroup);

    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(BRANCH_POPUP, actionGroup, true);
    toolbar.setTargetComponent(getList());
    toolbar.setReservePlaceAutoPopupIcon(false);
    toolbar.getComponent().setOpaque(false);
    getTitle().setButtonComponent(new ActiveComponent.Adapter() {
      @NotNull
      @Override
      public JComponent getComponent() {
        return toolbar.getComponent();
      }
    }, JBUI.Borders.emptyRight(2));
  }
private void createTitlePanelToolbar(@NotNull String dimensionKey)