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:
@@ -32,6 +32,11 @@ public final class DropDownToggleButton extends JPanel {
|
|||||||
public DropDownToggleButton(Icon icon, String tooltip, Supplier<JPopupMenu> menu) {
|
public DropDownToggleButton(Icon icon, String tooltip, Supplier<JPopupMenu> menu) {
|
||||||
super(new BorderLayout());
|
super(new BorderLayout());
|
||||||
setOpaque(false);
|
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.setIcon(icon);
|
||||||
button.setToolTipText(tooltip);
|
button.setToolTipText(tooltip);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user