[fixes #968] Fix motor mount cells foreground

This commit is contained in:
Sibo Van Gool 2021-07-25 01:29:29 +02:00
parent ebcdd469b7
commit 0f2b10b14b
2 changed files with 16 additions and 5 deletions

View File

@ -229,6 +229,11 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
T component = v.getV();
label = format(component, fcid, label );
}
for (Component c : label.getComponents()) {
if (c instanceof JLabel) {
setSelected((JLabel)c, table, isSelected, hasFocus);
}
}
setSelected(label, table, isSelected, hasFocus);
return label;
}
@ -242,7 +247,7 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
c.setForeground((Color)UIManager.get("Table.selectionForeground"));
} else {
c.setBackground(table.getBackground());
c.setForeground(table.getForeground());
c.setForeground(c.getForeground());
}
Border b = null;
if ( hasFocus ) {

View File

@ -1,11 +1,17 @@
package net.sf.openrocket.gui.widgets;
import net.sf.openrocket.gui.components.StageSelector;
import javax.swing.*;
import javax.swing.JToggleButton;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.UIManager;
import java.awt.Graphics;
import java.awt.Color;
/**
* This class is a replacement for the standard JToggleButton. Its purpose is to be able
* to control the foreground color for when the button is (de)selected.
*
* @author Sibo Van Gool <sibo.vangool@hotmail.com>
*/
public class SelectColorToggleButton extends JToggleButton {
public SelectColorToggleButton(Action a) {
super(a);