mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
hook the PhaseLabels up to the skin
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user