Tweak the sensor display

main
Clément FRÉVILLE 2 years ago
parent 905be56db9
commit 3b6918ed76

@ -169,6 +169,7 @@ public class MainWindows {
sensorTree.getSelectionModel().selectedItemProperty().addListener((list, oldValue, newValue) -> { sensorTree.getSelectionModel().selectedItemProperty().addListener((list, oldValue, newValue) -> {
if (oldValue != null && oldValue.getValue() != null) { if (oldValue != null && oldValue.getValue() != null) {
sensorName.textProperty().unbindBidirectional(oldValue.getValue().nameProperty()); sensorName.textProperty().unbindBidirectional(oldValue.getValue().nameProperty());
sensorName.setText(null);
sourcesView.itemsProperty().unbind(); sourcesView.itemsProperty().unbind();
sourcesView.setItems(FXCollections.emptyObservableList()); sourcesView.setItems(FXCollections.emptyObservableList());
if (oldValue.getValue() instanceof AutoSensor auto) { if (oldValue.getValue() instanceof AutoSensor auto) {

@ -36,7 +36,7 @@ public class ModalFactory {
public Stage createModal(Sensor sensor, Consumer<Pane> initializer) { public Stage createModal(Sensor sensor, Consumer<Pane> initializer) {
return createModal(root -> { return createModal(root -> {
Text name = new Text(); Text name = new Text();
name.textProperty().bind(sensor.displayNameExpression().concat(sensor.temperatureProperty().asString(" (%s°C)"))); name.textProperty().bind(sensor.displayNameExpression().concat(sensor.temperatureProperty().asString(" (%.1f°C)")));
root.getChildren().add(name); root.getChildren().add(name);
initializer.accept(root); initializer.accept(root);
}); });

@ -5,7 +5,7 @@ import javafx.scene.image.Image;
public class StandardImageSupplier implements ImageSupplier { public class StandardImageSupplier implements ImageSupplier {
private static final int HOT_THRESHOLD = 22; private static final int HOT_THRESHOLD = 22;
private static final int WARM_THRESHOLD = 10; private static final int WARM_THRESHOLD = 0;
private final Image hotImage; private final Image hotImage;
private final Image warmImage; private final Image warmImage;

Loading…
Cancel
Save