Added new improvements

This commit is contained in:
Robert Vokac 2024-01-28 15:48:24 +00:00
parent a3fe9c0d4c
commit 059c4afb2e
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055
3 changed files with 14 additions and 2 deletions

View File

@ -45,7 +45,9 @@ public class Battery extends Widget {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2d.fillRect(width_ / 4, 1, width_, totalHeight - 2);
if(!Utils.ultraLight.get()) {
g2d.fillRect(width_ / 4, 1, width_, totalHeight - 2);
}
g2d.setColor(Utils.highlighted.get() || mouseOver ? Color.BLACK :
Color.LIGHT_GRAY);
g2d.drawRect(width_ / 4 - 1, 0, width_ + 1, totalHeight + 0);
@ -59,6 +61,9 @@ public class Battery extends Widget {
g2d.setColor(donePercent < 0.1 ? LOW : (donePercent < 0.75 ?
MEDIUM : (donePercent < 0.9 ? HIGH : HIGHEST)));
}
if(Utils.ultraLight.get()) {
g2d.setColor(Utils.ULTRA_LIGHT_GRAY);
}
int doneHeight = (int) (totalHeight * donePercent);
int intX = width_ / 4;
int todoHeight = totalHeight - doneHeight;

View File

@ -102,6 +102,11 @@ public class TimeCalcWindow {
if(e.getKeyCode() == KeyEvent.VK_DOWN){
everythingHidden = true;
}
if(e.getKeyCode() == KeyEvent.VK_G){
Utils.ultraLight.flip();
}
window.repaint();
}
});
@ -203,7 +208,6 @@ public class TimeCalcWindow {
calNow.setTime(new Date());
LocalDate ld = LocalDate.of(calNow.get(Calendar.YEAR),calNow.get(Calendar.MONTH) + 1,1);
DayOfWeek firstDayOfMonth = ld.getDayOfWeek();
System.out.println("dow=" + firstDayOfMonth);
int currentDayOfMonth = calNow.get(Calendar.DAY_OF_MONTH);
int workDaysDone = 0;
@ -241,6 +245,7 @@ public class TimeCalcWindow {
window.dispose();
break;
}
text.setVisible(!everythingHidden);
progressSquare.setVisible(!everythingHidden);
progressCircle.setVisible(!everythingHidden);

View File

@ -13,6 +13,8 @@ import java.nio.file.Files;
*/
public class Utils {
public static final BooleanHolder highlighted = new BooleanHolder();
public static final BooleanHolder ultraLight = new BooleanHolder();
public static final Color ULTRA_LIGHT_GRAY = new Color(216,216,216);
/**
* Count of bytes per one kilobyte.
*/