Class SystemTheme

java.lang.Object
io.github.jbastgen.stemma.app.theme.SystemTheme

public final class SystemTheme extends Object
Whether the operating system is set to a light or a dark appearance, for the theme "Automatic". JavaFX 21 cannot tell, so the setting is read with the tool each system ships: defaults on macOS (10.14 and later), the registry on Windows 10 and later, and the desktop portal or gsettings on Linux (GNOME 42 and later, KDE Plasma 6 and other desktops with a portal). A system where none of these answers is "not supported": the option is then disabled and the chosen light or dark theme is used.
  • Method Details

    • supported

      public static boolean supported()
      Whether this system tells Stemma if it is light or dark. Reads the setting once to find out.
    • current

      public static Optional<Theme> current()
      The theme the system is set to as of the last reading; empty when the system does not say.
    • refresh

      public static boolean refresh()
      Reads the setting again. Returns true when the answer differs from the last one.