revert lambda processing

This commit is contained in:
Armin Schrenk
2026-02-16 11:07:04 +01:00
parent af43aeca15
commit cf0052b4f5

View File

@@ -47,14 +47,12 @@ public class FxApplicationStyle {
}
private void appThemeChanged(@SuppressWarnings("unused") ObservableValue<? extends UiTheme> observable, UiTheme oldValue, UiTheme newValue) {
if (oldValue == UiTheme.AUTOMATIC && newValue != UiTheme.AUTOMATIC) {
appearanceProvider.ifPresent(service -> {
try {
service.removeListener(systemInterfaceThemeListener);
} catch (UiAppearanceException e) {
LOG.warn("Failed to disable automatic theme switching.");
}
});
if (oldValue == UiTheme.AUTOMATIC && newValue != UiTheme.AUTOMATIC && appearanceProvider.isPresent()) {
try {
appearanceProvider.get().removeListener(systemInterfaceThemeListener);
} catch (UiAppearanceException e) {
LOG.warn("Failed to disable automatic theme switching.");
}
}
applyTheme(newValue);
}