Added several improvements XXXVI

This commit is contained in:
Robert Vokac 2024-01-21 11:52:00 +00:00
parent 54cdb97757
commit 0d3f06854c
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055
2 changed files with 6 additions and 4 deletions

View File

@ -17,8 +17,13 @@ public class ProgressSquare extends JPanel {
private int side = 0;
private int square;
private double donePercent = 0;
private boolean highlight = false;
public void setHighlight(boolean highlight) {
this.highlight = highlight;
}
public ProgressSquare() {
setPreferredSize(new Dimension(400, 400));
setBackground(BACKGROUND_COLOR);
@ -57,10 +62,6 @@ public class ProgressSquare extends JPanel {
@Override
public void paintComponent(Graphics g) {
if(donePercent >= 0.99) {
highlight = true;
}
if (side == 0) {
this.side = Math.min(getWidth(), getHeight());
this.square = side * side;

View File

@ -188,6 +188,7 @@ public class TimeCalcWindow {
}
if (hourRemains == 0 && minuteRemains <= 3) {
analogClock.setHighlight(true);
progressSquare.setHighlight(true);
text.setForeground(Color.BLUE);
}