Added new improvements

This commit is contained in:
Robert Vokac 2024-02-11 10:30:08 +00:00
parent 8775f573bb
commit 91cc332912
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055
4 changed files with 12 additions and 5 deletions

View File

@ -528,6 +528,11 @@ public class TimeCalcManager {
window.setSize(520 + 20 + 100, window.setSize(520 + 20 + 100,
exitButton.getY() + 3 * exitButton.getHeight() + MARGIN); exitButton.getY() + 3 * exitButton.getHeight() + MARGIN);
while (true) { while (true) {
Visibility visibility = Visibility
.valueOf(timeCalcApp.visibilityProperty.getValue());
if(timeCalcConfiguration.visibilityOnlyGreyOrNoneEnabledProperty.isEnabled() && visibility.isColored() ){
timeCalcApp.visibilityProperty.setValue(Visibility.GRAY.name());
}
//time.writeString(); //time.writeString();
if (stopBeforeEnd) { if (stopBeforeEnd) {
window.setVisible(false); window.setVisible(false);
@ -535,8 +540,7 @@ public class TimeCalcManager {
break; break;
} }
Visibility visibility = Visibility
.valueOf(timeCalcApp.visibilityProperty.getValue());
componentRegistry.setVisible(visibility.isNotNone()); componentRegistry.setVisible(visibility.isNotNone());
if (!visibility.isStronglyColored() || visibility.isGray()) { if (!visibility.isStronglyColored() || visibility.isGray()) {
configButton.setBackground(BG); configButton.setBackground(BG);

View File

@ -21,6 +21,9 @@ public enum Visibility {
return this == WEAKLY_COLORED; return this == WEAKLY_COLORED;
} }
public boolean isColored() {
return isStronglyColored() || isWeaklyColored();
}
public boolean isGray() { public boolean isGray() {
return this == GRAY; return this == GRAY;
} }

View File

@ -24,13 +24,13 @@ public class TimeCalcButton extends JButton {
public TimeCalcButton(String label) { public TimeCalcButton(String label) {
super(label); super(label);
new Timer(100, e -> repaint()).start();
} }
public void setBounds(int x, int y) { public void setBounds(int x, int y) {
setBounds(x, y, BUTTON_WIDTH, BUTTON_HEIGHT); setBounds(x, y, BUTTON_WIDTH, BUTTON_HEIGHT);
this.originalBackground = getBackground(); this.originalBackground = getBackground();
this.originalForeground = getForeground(); this.originalForeground = getForeground();
new Timer(100, e -> repaint()).start();
} }
public void setOriginalBackground() { public void setOriginalBackground() {

View File

@ -1,10 +1,10 @@
clock.hands.long=true clock.hands.long=true
clock.hands.minute.enabled=false clock.hands.minute.enabled=true
clock.hands.second.enabled=true clock.hands.second.enabled=true
clock.hands.millisecond.enabled=false clock.hands.millisecond.enabled=false
battery.waves.enabled=true battery.waves.enabled=true
default-visibility=STRONGLY_COLORED default-visibility=STRONGLY_COLORED
visibility.only-grey-or-none.enabled=true visibility.only-grey-or-none.enabled=false
jokes.enabled=true jokes.enabled=true
commands.enabled=true commands.enabled=true
toasts.enabled=true toasts.enabled=true