Hide currency choice box when there's only one currency in use for the profile.

This commit is contained in:
Andrew Lalis 2024-06-07 08:55:31 -04:00
parent a3558b33e6
commit 28002fd32d
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import com.andrewlalis.perfin.data.AccountRepository;
import com.andrewlalis.perfin.data.TimestampRange; import com.andrewlalis.perfin.data.TimestampRange;
import com.andrewlalis.perfin.data.util.ColorUtil; import com.andrewlalis.perfin.data.util.ColorUtil;
import com.andrewlalis.perfin.model.Profile; import com.andrewlalis.perfin.model.Profile;
import com.andrewlalis.perfin.view.BindingUtil;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
@ -52,6 +53,7 @@ public abstract class PieChartModule extends DashboardModule {
this.timeRangeChoiceBox.getItems().addAll(RANGE_CHOICES); this.timeRangeChoiceBox.getItems().addAll(RANGE_CHOICES);
this.timeRangeChoiceBox.getSelectionModel().select("All Time"); this.timeRangeChoiceBox.getSelectionModel().select("All Time");
this.currencyChoiceBox.managedProperty().bind(this.currencyChoiceBox.visibleProperty());
PieChart chart = new PieChart(chartData); PieChart chart = new PieChart(chartData);
chart.setLegendVisible(false); chart.setLegendVisible(false);
@ -136,6 +138,7 @@ public abstract class PieChartModule extends DashboardModule {
} else { } else {
currencyChoiceBox.getSelectionModel().selectFirst(); currencyChoiceBox.getSelectionModel().selectFirst();
} }
currencyChoiceBox.setVisible(orderedCurrencies.size() > 1);
}); });
}); });
} }