hook the PhaseLabels up to the skin

This commit is contained in:
slapshot5
2012-01-18 05:00:48 +00:00
parent 2459988592
commit d5d6d28fee

View File

@@ -747,7 +747,11 @@ public class ViewField extends FRoundedPanel {
private boolean enabled = true; private boolean enabled = true;
private boolean active = false; private boolean active = false;
private boolean hover = false; private boolean hover = false;
private final Color hoverBG = Singletons.getView().getSkin().getColor("hover"); private final Color defaultBG;
private final Color hoverBG;
private final Color pressedBG;
private final Color textColor;
/** /**
* Shows phase labels, handles repainting and on/off states. A * Shows phase labels, handles repainting and on/off states. A
@@ -762,6 +766,13 @@ public class ViewField extends FRoundedPanel {
this.setHorizontalTextPosition(SwingConstants.CENTER); this.setHorizontalTextPosition(SwingConstants.CENTER);
this.setHorizontalAlignment(SwingConstants.CENTER); this.setHorizontalAlignment(SwingConstants.CENTER);
defaultBG = ViewField.this.skin.getColor("active");
hoverBG = ViewField.this.skin.getColor("hover");
pressedBG = ViewField.this.skin.getColor("inactive");
textColor = ViewField.this.skin.getColor("text");
this.setForeground(textColor);
this.addMouseListener(new MouseAdapter() { this.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(final MouseEvent e) { public void mousePressed(final MouseEvent e) {
@@ -838,11 +849,11 @@ public class ViewField extends FRoundedPanel {
// Set color according to skip or active or hover state of label // Set color according to skip or active or hover state of label
if (this.hover) { if (this.hover) {
c = this.hoverBG; c = PhaseLabel.this.hoverBG;
} else if (this.enabled) { } else if (this.enabled) {
c = Color.green; c = PhaseLabel.this.defaultBG;
} else { } else {
c = Color.red; c = PhaseLabel.this.pressedBG;
} }
if (!this.active && !this.hover) { if (!this.active && !this.hover) {