[#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
|
if (UIManager.getColor("Button.selectForeground") == null
|
||||||
|| UIManager.getColor("Button.foreground") == null)
|
|| UIManager.getColor("Button.foreground") == null)
|
||||||
return;
|
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() {
|
addChangeListener(new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void stateChanged(ChangeEvent e) {
|
public void stateChanged(ChangeEvent e) {
|
||||||
|
@ -64,6 +64,9 @@ public class SelectColorToggleButton extends JToggleButton {
|
|||||||
|| UIManager.getColor("ToggleButton.foreground") == null)
|
|| UIManager.getColor("ToggleButton.foreground") == null)
|
||||||
return;
|
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
|
// Case: frame goes out of focus
|
||||||
addPropertyChangeListener("Frame.active", new PropertyChangeListener() {
|
addPropertyChangeListener("Frame.active", new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user