[#1099] Fix button grey out on macOS
This commit is contained in:
parent
3148a25217
commit
e516ddb223
@ -38,6 +38,10 @@ public class SelectColorButton extends JButton {
|
||||
if (UIManager.getColor("Button.selectForeground") == null
|
||||
|| UIManager.getColor("Button.foreground") == null)
|
||||
return;
|
||||
|
||||
// Fixes the issue of the background of the button not being blue when selected on macOS
|
||||
putClientProperty("JButton.buttonType", "segmented-only");
|
||||
|
||||
addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
|
@ -64,6 +64,9 @@ public class SelectColorToggleButton extends JToggleButton {
|
||||
|| UIManager.getColor("ToggleButton.foreground") == null)
|
||||
return;
|
||||
|
||||
// Fixes the issue of the background of the button not being blue when selected on macOS
|
||||
putClientProperty("JButton.buttonType", "segmented-only");
|
||||
|
||||
// Case: frame goes out of focus
|
||||
addPropertyChangeListener("Frame.active", new PropertyChangeListener() {
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user