From d5d6d28fee9cad14ce096583ca851137e9f5279c Mon Sep 17 00:00:00 2001 From: slapshot5 Date: Wed, 18 Jan 2012 05:00:48 +0000 Subject: [PATCH] hook the PhaseLabels up to the skin --- src/main/java/forge/view/match/ViewField.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/forge/view/match/ViewField.java b/src/main/java/forge/view/match/ViewField.java index 6f26fdd54ad..b9e9c02c6e1 100644 --- a/src/main/java/forge/view/match/ViewField.java +++ b/src/main/java/forge/view/match/ViewField.java @@ -747,7 +747,11 @@ public class ViewField extends FRoundedPanel { private boolean enabled = true; private boolean active = 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 @@ -761,6 +765,13 @@ public class ViewField extends FRoundedPanel { super(txt); this.setHorizontalTextPosition(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() { @Override @@ -838,11 +849,11 @@ public class ViewField extends FRoundedPanel { // Set color according to skip or active or hover state of label if (this.hover) { - c = this.hoverBG; + c = PhaseLabel.this.hoverBG; } else if (this.enabled) { - c = Color.green; + c = PhaseLabel.this.defaultBG; } else { - c = Color.red; + c = PhaseLabel.this.pressedBG; } if (!this.active && !this.hover) {