change println() to LOG calls

This commit is contained in:
Anton Keks 2020-05-13 00:12:28 +03:00
parent 5b009b2a60
commit e6fa4dabbf

View File

@ -70,17 +70,17 @@ public class GUI implements AutoCloseable {
Class os = Class.forName("org.eclipse.swt.internal.cocoa.OS");
Boolean isDarkMode = (Boolean) os.getMethod("isSystemDarkAppearance").invoke(null);
Boolean isAppDarkAppearance = (Boolean) os.getMethod("isAppDarkAppearance").invoke(null);
System.err.println("Dark appearance flags before: " + isDarkMode + ", " + isAppDarkAppearance);
LOG.info("Dark appearance flags before: " + isDarkMode + ", " + isAppDarkAppearance);
if (isDarkMode && !isAppDarkAppearance) {
os.getMethod("setTheme", boolean.class).invoke(null, isDarkMode);
isDarkMode = (Boolean) os.getMethod("isSystemDarkAppearance").invoke(null);
isAppDarkAppearance = (Boolean) os.getMethod("isAppDarkAppearance").invoke(null);
System.err.println("Dark appearance flags after: " + isDarkMode + ", " + isAppDarkAppearance);
LOG.info("Dark appearance flags after: " + isDarkMode + ", " + isAppDarkAppearance);
// workaround for a bug in SWT: colors need to be reinited after changing the appearance
Method initColors = display.getClass().getDeclaredMethod("initColors");
initColors.setAccessible(true);
initColors.invoke(display);
System.err.println("initColors called");
LOG.info("initColors called");
}
}
catch (Exception e) {