ActionToolbarImpl () { AnAction likeAction = createFeedbackAction(IdeBundle.message("tip.of.the.day.feedback.like"), AllIcons.Ide.LikeDimmed, AllIcons.Ide.Like, AllIcons.Ide.LikeSelected, true); AnAction dislikeAction = createFeedbackAction(IdeBundle.message("tip.of.the.day.feedback.dislike"), AllIcons.Ide.DislikeDimmed, AllIcons.Ide.Dislike, AllIcons.Ide.DislikeSelected, false); ActionGroup group = new DefaultActionGroup(likeAction, dislikeAction); ActionToolbarImpl toolbar = new ActionToolbarImpl("TipsAndTricksDialog", group, true) { @Override protected @NotNull ActionButton createToolbarButton(@NotNull AnAction action, ActionButtonLook look, @NotNull String place, @NotNull Presentation presentation, Supplier<? extends @NotNull Dimension> minimumSize) { ActionButton button = new ActionButton(action, presentation, place, getFeedbackButtonSize()) { @Override protected void paintButtonLook(Graphics g) { // do not paint an icon background getButtonLook().paintIcon(g, this, getIcon()); } @Override public Dimension getPreferredSize() { return getFeedbackButtonSize(); } @Override public Dimension getMaximumSize() { return getFeedbackButtonSize(); } }; int iconIndent = TipUiSettings.getFeedbackIconIndent(); button.setBorder(BorderFactory.createEmptyBorder(iconIndent, iconIndent, iconIndent, iconIndent)); button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); return button; } @Override public @NotNull Dimension getPreferredSize() { Dimension size = getFeedbackButtonSize(); int buttonsCount = getActionGroup().getChildren(null).length; return new Dimension(size.width * buttonsCount, size.height); } @Override public Dimension getMinimumSize() { return getPreferredSize(); } @Override public Dimension getMaximumSize() { return getPreferredSize(); } }; toolbar.setBackground(TipUiSettings.getPanelBackground()); toolbar.setBorder(JBUI.Borders.empty()); toolbar.setTargetComponent(this); return toolbar; }