more control over colors for the footer updates indicator

This commit is contained in:
Ben Fry
2022-01-13 15:55:35 -05:00
parent c2859b855d
commit 1098550587
2 changed files with 13 additions and 6 deletions

View File

@@ -72,7 +72,9 @@ public class EditorFooter extends Box {
Color[] textColor = new Color[2];
Color[] tabColor = new Color[2];
Color updateColor;
Color updatesTextColor;
Color indicatorFieldColor;
Color indicatorTextColor;
int updateLeft;
Editor editor;
@@ -168,7 +170,10 @@ public class EditorFooter extends Box {
tabColor[SELECTED] = Theme.getColor("footer.tab.selected.color");
tabColor[ENABLED] = Theme.getColor("footer.tab.enabled.color");
updateColor = Theme.getColor("footer.updates.color");
updatesTextColor = Theme.getColor("footer.updates.text.color");
indicatorFieldColor = Theme.getColor("footer.updates.indicator.field.color");
indicatorTextColor = Theme.getColor("footer.updates.indicator.text.color");
controller.repaint();
gradient = Theme.makeGradient("footer", 400, HIGH);
// Set the default background color in case the window size reported
@@ -303,13 +308,13 @@ public class EditorFooter extends Box {
float diameter = (float) (2 * (Math.max(countHeight, countWidth)/2 + CIRCULAR_PADDING));
float ex = getWidth() - Editor.RIGHT_GUTTER - diameter;
float ey = (getHeight() - diameter) / 2;
g2.setColor(updateColor);
g2.setColor(indicatorFieldColor);
g2.fill(new Ellipse2D.Float(ex, ey, diameter, diameter));
g2.setColor(textColor[SELECTED]);
g2.setColor(indicatorTextColor);
int baseline = (getHeight() + fontAscent) / 2;
g2.drawString(updatesStr, (int) (ex + (diameter - countWidth)/2), baseline);
double updatesWidth = font.getStringBounds(updateLabel, frc).getWidth();
g2.setColor(textColor[ENABLED]);
g2.setColor(updatesTextColor);
updateLeft = (int) (ex - updatesWidth - GAP);
g2.drawString(updateLabel, updateLeft, baseline);
}

View File

@@ -89,7 +89,9 @@ footer.gradient.top = #1e4492
footer.gradient.bottom = #0f408d
footer.tab.selected.color = #3369db
footer.tab.enabled.color = #161e3f
footer.updates.color = #fed456
footer.updates.text.color = #dae8ff
footer.updates.indicator.field.color = #fed456
footer.updates.indicator.text.color = #ffffff
## EditorConsole - stack traces of doom and println() ##