Browse Source

Provide default ThemeProvider factory method.

pull/214/head
weisj 4 years ago
parent
commit
b99b42e2d6
  1. 3
      core/src/main/java/com/github/weisj/darklaf/LafManager.java
  2. 4
      theme/src/main/java/com/github/weisj/darklaf/theme/info/ThemeProvider.java

3
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();
}
/**

4
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);
}

Loading…
Cancel
Save