mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added new improvements
This commit is contained in:
parent
a3fe9c0d4c
commit
059c4afb2e
@ -45,7 +45,9 @@ public class Battery extends Widget {
|
|||||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
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 :
|
g2d.setColor(Utils.highlighted.get() || mouseOver ? Color.BLACK :
|
||||||
Color.LIGHT_GRAY);
|
Color.LIGHT_GRAY);
|
||||||
g2d.drawRect(width_ / 4 - 1, 0, width_ + 1, totalHeight + 0);
|
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 ?
|
g2d.setColor(donePercent < 0.1 ? LOW : (donePercent < 0.75 ?
|
||||||
MEDIUM : (donePercent < 0.9 ? HIGH : HIGHEST)));
|
MEDIUM : (donePercent < 0.9 ? HIGH : HIGHEST)));
|
||||||
}
|
}
|
||||||
|
if(Utils.ultraLight.get()) {
|
||||||
|
g2d.setColor(Utils.ULTRA_LIGHT_GRAY);
|
||||||
|
}
|
||||||
int doneHeight = (int) (totalHeight * donePercent);
|
int doneHeight = (int) (totalHeight * donePercent);
|
||||||
int intX = width_ / 4;
|
int intX = width_ / 4;
|
||||||
int todoHeight = totalHeight - doneHeight;
|
int todoHeight = totalHeight - doneHeight;
|
||||||
|
@ -102,6 +102,11 @@ public class TimeCalcWindow {
|
|||||||
if(e.getKeyCode() == KeyEvent.VK_DOWN){
|
if(e.getKeyCode() == KeyEvent.VK_DOWN){
|
||||||
everythingHidden = true;
|
everythingHidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e.getKeyCode() == KeyEvent.VK_G){
|
||||||
|
Utils.ultraLight.flip();
|
||||||
|
}
|
||||||
|
|
||||||
window.repaint();
|
window.repaint();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -203,7 +208,6 @@ public class TimeCalcWindow {
|
|||||||
calNow.setTime(new Date());
|
calNow.setTime(new Date());
|
||||||
LocalDate ld = LocalDate.of(calNow.get(Calendar.YEAR),calNow.get(Calendar.MONTH) + 1,1);
|
LocalDate ld = LocalDate.of(calNow.get(Calendar.YEAR),calNow.get(Calendar.MONTH) + 1,1);
|
||||||
DayOfWeek firstDayOfMonth = ld.getDayOfWeek();
|
DayOfWeek firstDayOfMonth = ld.getDayOfWeek();
|
||||||
System.out.println("dow=" + firstDayOfMonth);
|
|
||||||
int currentDayOfMonth = calNow.get(Calendar.DAY_OF_MONTH);
|
int currentDayOfMonth = calNow.get(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
int workDaysDone = 0;
|
int workDaysDone = 0;
|
||||||
@ -241,6 +245,7 @@ public class TimeCalcWindow {
|
|||||||
window.dispose();
|
window.dispose();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
text.setVisible(!everythingHidden);
|
text.setVisible(!everythingHidden);
|
||||||
progressSquare.setVisible(!everythingHidden);
|
progressSquare.setVisible(!everythingHidden);
|
||||||
progressCircle.setVisible(!everythingHidden);
|
progressCircle.setVisible(!everythingHidden);
|
||||||
|
@ -13,6 +13,8 @@ import java.nio.file.Files;
|
|||||||
*/
|
*/
|
||||||
public class Utils {
|
public class Utils {
|
||||||
public static final BooleanHolder highlighted = new BooleanHolder();
|
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.
|
* Count of bytes per one kilobyte.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user