From b99b42e2d61da471593e52ee569a37d01a5db599 Mon Sep 17 00:00:00 2001 From: weisj Date: Fri, 18 Sep 2020 23:42:19 +0200 Subject: [PATCH] Provide default ThemeProvider factory method. --- core/src/main/java/com/github/weisj/darklaf/LafManager.java | 3 +-- .../com/github/weisj/darklaf/theme/info/ThemeProvider.java | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/LafManager.java b/core/src/main/java/com/github/weisj/darklaf/LafManager.java index f6d81c2c..aec95321 100644 --- a/core/src/main/java/com/github/weisj/darklaf/LafManager.java +++ b/core/src/main/java/com/github/weisj/darklaf/LafManager.java @@ -38,7 +38,6 @@ import com.github.weisj.darklaf.task.DefaultsAdjustmentTask; import com.github.weisj.darklaf.task.DefaultsInitTask; import com.github.weisj.darklaf.theme.Theme; import com.github.weisj.darklaf.theme.event.*; -import com.github.weisj.darklaf.theme.info.DefaultThemeProvider; import com.github.weisj.darklaf.theme.info.PreferredThemeStyle; import com.github.weisj.darklaf.theme.info.ThemeProvider; import com.github.weisj.darklaf.theme.laf.ThemedLookAndFeel; @@ -226,7 +225,7 @@ public final class LafManager { * Default theme provider. Defaults to IntelliJ/Darcula Light/Dark high contrast themes. */ private static ThemeProvider createDefaultThemeProvider() { - return new DefaultThemeProvider(); + return ThemeProvider.createDefault(); } /** diff --git a/theme/src/main/java/com/github/weisj/darklaf/theme/info/ThemeProvider.java b/theme/src/main/java/com/github/weisj/darklaf/theme/info/ThemeProvider.java index bb2df8e7..c436cf0d 100644 --- a/theme/src/main/java/com/github/weisj/darklaf/theme/info/ThemeProvider.java +++ b/theme/src/main/java/com/github/weisj/darklaf/theme/info/ThemeProvider.java @@ -27,6 +27,10 @@ public interface ThemeProvider { Theme getTheme(final PreferredThemeStyle themeStyle); + static ThemeProvider createDefault() { + return new DefaultThemeProvider(); + } + static ThemeProvider fromThemes(final Theme lightTheme, final Theme darkTheme) { return new DefaultThemeProvider(lightTheme, darkTheme); }