void (Graphics g) { ActionButtonLook look = getButtonLook(); if (selectedActionEnabled() || !StartupUiUtil.isUnderDarcula()) { int state = getPopState(); if (state == PUSHED) state = POPPED; look.paintBackground(g, this, state); } Rectangle baseRect = new Rectangle(getSize()); JBInsets.removeFrom(baseRect, getInsets()); if (getPopState() == PUSHED && mousePressType != MousePressType.None && selectedActionEnabled() || isToggleActionPushed()) { int arrowWidth = ARROW_DOWN.getIconWidth() + JBUIScale.scale(7); Shape clip = g.getClip(); Area buttonClip = new Area(clip); Rectangle execButtonRect = new Rectangle(baseRect.x, baseRect.y, baseRect.width - arrowWidth, baseRect.height); if (mousePressType == MousePressType.Action || isToggleActionPushed()) { buttonClip.intersect(new Area(execButtonRect)); } else if (mousePressType == MousePressType.Popup) { Rectangle arrowButtonRect = new Rectangle(execButtonRect.x + execButtonRect.width, baseRect.y, arrowWidth, baseRect.height); buttonClip.intersect(new Area(arrowButtonRect)); } g.setClip(buttonClip); look.paintBackground(g, this, PUSHED); g.setClip(clip); } int x = baseRect.x + baseRect.width - JBUIScale.scale(3) - ARROW_DOWN.getIconWidth(); int y = baseRect.y + (baseRect.height - ARROW_DOWN.getIconHeight()) / 2 + JBUIScale.scale(1); ARROW_DOWN.paintIcon(this, g, x, y); x -= JBUIScale.scale(4); int popState = getPopState(); if (popState == POPPED || popState == PUSHED) { g.setColor(JBUI.CurrentTheme.ActionButton.hoverSeparatorColor()); g.fillRect(x, baseRect.y, JBUIScale.scale(1), baseRect.height); } Icon actionIcon = getIcon(); if (!selectedActionEnabled()) { Icon disabledIcon = myPresentation.getDisabledIcon(); actionIcon = disabledIcon != null || actionIcon == null ? disabledIcon : IconLoader.getDisabledIcon(actionIcon); if (actionIcon == null) { actionIcon = getFallbackIcon(false); } } x = baseRect.x + (x - baseRect.x - actionIcon.getIconWidth()) / 2; y = baseRect.y + (baseRect.height - actionIcon.getIconHeight()) / 2; look.paintIcon(g, this, actionIcon, x, y); }