Paint the Away button as flat as its neighbours

Inside its panel it was drawn as a filled button, which read as half-active.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 06:58:08 +00:00
parent f480262c39
commit a4a8b39410

View File

@@ -32,6 +32,11 @@ public final class DropDownToggleButton extends JPanel {
public DropDownToggleButton(Icon icon, String tooltip, Supplier<JPopupMenu> menu) {
super(new BorderLayout());
setOpaque(false);
// Sitting inside this panel, the halves are not toolbar children any more, so the
// look and feel would paint them as filled buttons; ask for the flat toolbar look
// the plain toggles next to us get.
button.putClientProperty("JButton.buttonType", "toolBarButton");
arrow.putClientProperty("JButton.buttonType", "toolBarButton");
button.setIcon(icon);
button.setToolTipText(tooltip);