Search in sources :

Example 1 with Theme

use of com.faforever.client.theme.Theme in project downlords-faf-client by FAForever.

the class SettingsController method configureThemeSelection.

private void configureThemeSelection(Preferences preferences) {
    themeComboBox.setItems(FXCollections.observableArrayList(uiService.getAvailableThemes()));
    themeComboBox.getSelectionModel().selectedItemProperty().addListener(new WeakChangeListener<>(themeChangeListener));
    Theme currentTheme = themeComboBox.getItems().stream().filter(theme -> theme.getDisplayName().equals(preferences.getThemeName())).findFirst().orElse(DEFAULT_THEME);
    themeComboBox.getSelectionModel().select(currentTheme);
    uiService.currentThemeProperty().addListener((observable, oldValue, newValue) -> themeComboBox.getSelectionModel().select(newValue));
}
Also used : Theme(com.faforever.client.theme.Theme)

Aggregations

Theme (com.faforever.client.theme.Theme)1