mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added improvements
This commit is contained in:
parent
1a187ca1ed
commit
488dda556a
@ -97,10 +97,12 @@ public class TimeCalcConfiguration {
|
|||||||
public final BooleanProperty notificationsVisibleProperty
|
public final BooleanProperty notificationsVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.NOTIFICATIONS_VISIBLE
|
= new BooleanProperty(TimeCalcProperty.NOTIFICATIONS_VISIBLE
|
||||||
.getKey());
|
.getKey());
|
||||||
public final BooleanProperty smileysColoredProperty
|
public final BooleanProperty smileysVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.SMILEYS_COLORED.getKey());
|
= new BooleanProperty(TimeCalcProperty.SMILEYS_VISIBLE.getKey());
|
||||||
public final BooleanProperty smileysVisibleOnlyIfMouseMovingOverProperty
|
public final BooleanProperty smileysVisibleOnlyIfMouseMovingOverProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.SMILEYS_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER.getKey());
|
= new BooleanProperty(TimeCalcProperty.SMILEYS_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER.getKey());
|
||||||
|
public final BooleanProperty smileysColoredProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.SMILEYS_COLORED.getKey());
|
||||||
|
|
||||||
public final BooleanProperty squareVisibleProperty
|
public final BooleanProperty squareVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.SQUARE_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.SQUARE_VISIBLE.getKey());
|
||||||
@ -137,8 +139,9 @@ public class TimeCalcConfiguration {
|
|||||||
jokesVisibleProperty,
|
jokesVisibleProperty,
|
||||||
commandsVisibleProperty,
|
commandsVisibleProperty,
|
||||||
notificationsVisibleProperty,
|
notificationsVisibleProperty,
|
||||||
smileysColoredProperty,
|
smileysVisibleProperty,
|
||||||
smileysVisibleOnlyIfMouseMovingOverProperty,
|
smileysVisibleOnlyIfMouseMovingOverProperty,
|
||||||
|
smileysColoredProperty,
|
||||||
squareVisibleProperty,}) {
|
squareVisibleProperty,}) {
|
||||||
allProperties.add(p);
|
allProperties.add(p);
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,10 @@ public enum TimeCalcProperty {
|
|||||||
JOKES_VISIBLE("jokes.visible", "Jokes"),
|
JOKES_VISIBLE("jokes.visible", "Jokes"),
|
||||||
COMMANDS_VISIBLE("commands.visible", "Commands"),
|
COMMANDS_VISIBLE("commands.visible", "Commands"),
|
||||||
NOTIFICATIONS_VISIBLE("notifications.visible", "Notifications"),
|
NOTIFICATIONS_VISIBLE("notifications.visible", "Notifications"),
|
||||||
SMILEYS_COLORED("smileys.colored", "Smileys : Colored"),
|
SMILEYS_VISIBLE("smileys.visible", "Smileys"),
|
||||||
SMILEYS_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER("smileys.visible-only-if-mouse-moving-over", "Smileys : Visible only, if mouse moving over"),
|
SMILEYS_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER("smileys.visible-only-if-mouse-moving-over", "Smileys : Visible only, if mouse moving over"),
|
||||||
|
SMILEYS_COLORED("smileys.colored", "Smileys : Colored"),
|
||||||
|
|
||||||
|
|
||||||
SQUARE_VISIBLE("square.visible", "Square");
|
SQUARE_VISIBLE("square.visible", "Square");
|
||||||
|
|
||||||
|
@ -97,10 +97,14 @@ public class ConfigWindow extends TWindow {
|
|||||||
= new JCheckBox(TimeCalcProperty.COMMANDS_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.COMMANDS_VISIBLE.getKey());
|
||||||
private JCheckBox notificationsVisibleProperty
|
private JCheckBox notificationsVisibleProperty
|
||||||
= new JCheckBox(TimeCalcProperty.NOTIFICATIONS_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.NOTIFICATIONS_VISIBLE.getKey());
|
||||||
private JCheckBox smileysColoredProperty
|
|
||||||
= new JCheckBox(TimeCalcProperty.SMILEYS_COLORED.getKey());
|
|
||||||
private JCheckBox smileysVisibleOnlyIfMouseMovingOverProperty
|
private JCheckBox smileysVisibleOnlyIfMouseMovingOverProperty
|
||||||
= new JCheckBox(TimeCalcProperty.SMILEYS_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER.getKey());
|
= new JCheckBox(TimeCalcProperty.SMILEYS_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER.getKey());
|
||||||
|
private JCheckBox smileysVisibleProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.SMILEYS_VISIBLE.getKey());
|
||||||
|
private JCheckBox smileysColoredProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.SMILEYS_COLORED.getKey());
|
||||||
|
|
||||||
|
|
||||||
private JCheckBox squareVisibleProperty
|
private JCheckBox squareVisibleProperty
|
||||||
= new JCheckBox(TimeCalcProperty.SQUARE_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.SQUARE_VISIBLE.getKey());
|
||||||
@ -112,10 +116,10 @@ public class ConfigWindow extends TWindow {
|
|||||||
setLayout(null);
|
setLayout(null);
|
||||||
|
|
||||||
add(enableAsMuchAsPossible);
|
add(enableAsMuchAsPossible);
|
||||||
enableAsMuchAsPossible.setBounds(SwingUtils.MARGIN, currentY, 200,
|
enableAsMuchAsPossible.setBounds(SwingUtils.MARGIN, currentY, 250,
|
||||||
HEIGHT1);
|
HEIGHT1);
|
||||||
add(disableAsMuchAsPossible);
|
add(disableAsMuchAsPossible);
|
||||||
disableAsMuchAsPossible.setBounds(enableAsMuchAsPossible.getX() + enableAsMuchAsPossible.getWidth() + SwingUtils.MARGIN, currentY, 200,
|
disableAsMuchAsPossible.setBounds(enableAsMuchAsPossible.getX() + enableAsMuchAsPossible.getWidth() + SwingUtils.MARGIN, currentY, 250,
|
||||||
HEIGHT1);
|
HEIGHT1);
|
||||||
nextRow();
|
nextRow();
|
||||||
for(boolean enable:new boolean[]{true, false}) {
|
for(boolean enable:new boolean[]{true, false}) {
|
||||||
@ -150,8 +154,9 @@ public class ConfigWindow extends TWindow {
|
|||||||
jokesVisibleProperty.setSelected(true);
|
jokesVisibleProperty.setSelected(true);
|
||||||
commandsVisibleProperty.setSelected(enable);
|
commandsVisibleProperty.setSelected(enable);
|
||||||
notificationsVisibleProperty.setSelected(enable);
|
notificationsVisibleProperty.setSelected(enable);
|
||||||
smileysVisibleOnlyIfMouseMovingOverProperty.setSelected(!enable);
|
smileysVisibleProperty.setSelected(enable);
|
||||||
smileysColoredProperty.setSelected(enable);
|
smileysColoredProperty.setSelected(enable);
|
||||||
|
smileysVisibleOnlyIfMouseMovingOverProperty.setSelected(!enable);
|
||||||
squareVisibleProperty.setSelected(true);
|
squareVisibleProperty.setSelected(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -182,6 +187,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
jokesVisibleProperty,
|
jokesVisibleProperty,
|
||||||
commandsVisibleProperty,
|
commandsVisibleProperty,
|
||||||
notificationsVisibleProperty,
|
notificationsVisibleProperty,
|
||||||
|
smileysVisibleProperty,
|
||||||
smileysVisibleOnlyIfMouseMovingOverProperty,
|
smileysVisibleOnlyIfMouseMovingOverProperty,
|
||||||
smileysColoredProperty,
|
smileysColoredProperty,
|
||||||
squareVisibleProperty));
|
squareVisibleProperty));
|
||||||
|
@ -345,8 +345,9 @@ public class MainWindow extends TWindow {
|
|||||||
componentRegistry.getSet().stream().filter(c -> c instanceof Widget).forEach(c
|
componentRegistry.getSet().stream().filter(c -> c instanceof Widget).forEach(c
|
||||||
-> {
|
-> {
|
||||||
Widget widget = (Widget) c;
|
Widget widget = (Widget) c;
|
||||||
widget.smileysColoredProperty.bindTo(timeCalcConfiguration.smileysColoredProperty);
|
widget.smileysVisibleProperty.bindTo(timeCalcConfiguration.smileysVisibleProperty);
|
||||||
widget.smileysVisibleOnlyIfMouseMovingOverProperty.bindTo(timeCalcConfiguration.smileysVisibleOnlyIfMouseMovingOverProperty);
|
widget.smileysVisibleOnlyIfMouseMovingOverProperty.bindTo(timeCalcConfiguration.smileysVisibleOnlyIfMouseMovingOverProperty);
|
||||||
|
widget.smileysColoredProperty.bindTo(timeCalcConfiguration.smileysColoredProperty);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
setSize(dayBattery.getX() + dayBattery.getWidth() + 3 * SwingUtils.MARGIN,
|
setSize(dayBattery.getX() + dayBattery.getWidth() + 3 * SwingUtils.MARGIN,
|
||||||
|
@ -39,14 +39,16 @@ public class Widget extends JPanel implements
|
|||||||
public StringProperty visibilityProperty
|
public StringProperty visibilityProperty
|
||||||
= new StringProperty("widget.visibilityProperty",
|
= new StringProperty("widget.visibilityProperty",
|
||||||
Visibility.STRONGLY_COLORED.name());
|
Visibility.STRONGLY_COLORED.name());
|
||||||
public final BooleanProperty smileysColoredProperty
|
|
||||||
= new BooleanProperty("smileysColoredProperty", true);
|
|
||||||
public final BooleanProperty visibilitySupportedColoredProperty
|
public final BooleanProperty visibilitySupportedColoredProperty
|
||||||
= new BooleanProperty("visibilitySupportedColoredProperty", true);
|
= new BooleanProperty("visibilitySupportedColoredProperty", true);
|
||||||
public final BooleanProperty visibleProperty
|
public final BooleanProperty visibleProperty
|
||||||
= new BooleanProperty("visibleProperty", true);
|
= new BooleanProperty("visibleProperty", true);
|
||||||
|
public final BooleanProperty smileysVisibleProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.SMILEYS_VISIBLE.getKey());
|
||||||
public final BooleanProperty smileysVisibleOnlyIfMouseMovingOverProperty
|
public final BooleanProperty smileysVisibleOnlyIfMouseMovingOverProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.SMILEYS_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER.getKey());
|
= new BooleanProperty(TimeCalcProperty.SMILEYS_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER.getKey());
|
||||||
|
public final BooleanProperty smileysColoredProperty
|
||||||
|
= new BooleanProperty("smileysColoredProperty", true);
|
||||||
protected int side = 0;
|
protected int side = 0;
|
||||||
protected double donePercent = 0;
|
protected double donePercent = 0;
|
||||||
protected boolean mouseOver = false;
|
protected boolean mouseOver = false;
|
||||||
@ -181,7 +183,7 @@ public class Widget extends JPanel implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void paintSmiley(Visibility visibility, Graphics2D brush, int x, int y) {
|
protected void paintSmiley(Visibility visibility, Graphics2D brush, int x, int y) {
|
||||||
if (!mouseOver && smileysVisibleOnlyIfMouseMovingOverProperty.isEnabled()) {
|
if (smileysVisibleProperty.isDisabled() || (!mouseOver && smileysVisibleOnlyIfMouseMovingOverProperty.isEnabled())) {
|
||||||
if (this.smileyIcon != null) {
|
if (this.smileyIcon != null) {
|
||||||
this.remove(smileyIcon);
|
this.remove(smileyIcon);
|
||||||
this.smileyIcon = null;
|
this.smileyIcon = null;
|
||||||
|
@ -27,6 +27,7 @@ battery.label.visible=true
|
|||||||
jokes.visible=true
|
jokes.visible=true
|
||||||
commands.visible=true
|
commands.visible=true
|
||||||
notifications.visible=true
|
notifications.visible=true
|
||||||
|
smileys.visible=true
|
||||||
smileys.visible-only-if-mouse-moving-over=true
|
smileys.visible-only-if-mouse-moving-over=true
|
||||||
smileys.colored=true
|
smileys.colored=true
|
||||||
square.visible=true
|
square.visible=true
|
||||||
@ -51,4 +52,4 @@ battery.week.visible=true
|
|||||||
battery.month.visible=true
|
battery.month.visible=true
|
||||||
battery.year.visible=true
|
battery.year.visible=true
|
||||||
battery.blinking-if-critical-low=true
|
battery.blinking-if-critical-low=true
|
||||||
smileys.visible=true
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user