|
1 | 1 | package listfix.view;
|
2 | 2 |
|
3 | 3 | import com.jcabi.manifests.Manifests;
|
4 |
| -import com.jgoodies.looks.plastic.PlasticLookAndFeel; |
5 |
| -import com.jgoodies.looks.plastic.theme.DarkStar; |
6 |
| -import com.jgoodies.looks.plastic.theme.LightGray; |
7 |
| -import com.jgoodies.looks.plastic.theme.SkyBlue; |
8 | 4 | import io.github.borewit.lizzy.playlist.PlaylistFormat;
|
9 | 5 | import listfix.config.*;
|
10 | 6 | import listfix.controller.ListFixController;
|
@@ -121,6 +117,20 @@ private void postInitComponents()
|
121 | 117 | // Set the user-selected font and look & feel
|
122 | 118 | final IAppOptions appConfig = this.getApplicationConfig();
|
123 | 119 | setApplicationFont(appConfig.getAppFont());
|
| 120 | + |
| 121 | + if (appConfig.getLookAndFeel() == null || appConfig.getLookAndFeel().isEmpty()) |
| 122 | + { |
| 123 | + appConfig.setLookAndFeel( |
| 124 | + Arrays.stream(UIManager.getInstalledLookAndFeels()) |
| 125 | + .filter(laf -> laf.getName().equals("Nimbus")) |
| 126 | + .map(laf -> laf.getClassName()) |
| 127 | + .findFirst() |
| 128 | + .orElse(UIManager.getSystemLookAndFeelClassName() |
| 129 | + ) |
| 130 | + ); |
| 131 | + _logger.info("Initialize default look & feel to " + appConfig.getLookAndFeel()); |
| 132 | + } |
| 133 | + |
124 | 134 | this.setLookAndFeel(appConfig.getLookAndFeel());
|
125 | 135 |
|
126 | 136 | configureFileAndFolderChoosers();
|
@@ -2416,31 +2426,7 @@ private void setLookAndFeel(String className)
|
2416 | 2426 | {
|
2417 | 2427 | try
|
2418 | 2428 | {
|
2419 |
| - String realClassName = className; |
2420 |
| - if (className.equalsIgnoreCase("com.jgoodies.looks.plastic.theme.DarkStar")) |
2421 |
| - { |
2422 |
| - PlasticLookAndFeel.setPlasticTheme(new DarkStar()); |
2423 |
| - realClassName = "com.jgoodies.looks.plastic.PlasticLookAndFeel"; |
2424 |
| - } |
2425 |
| - else if (className.equals("com.jgoodies.looks.plastic.theme.SkyBlue")) |
2426 |
| - { |
2427 |
| - PlasticLookAndFeel.setPlasticTheme(new SkyBlue()); |
2428 |
| - realClassName = "com.jgoodies.looks.plastic.PlasticLookAndFeel"; |
2429 |
| - } |
2430 |
| - else if (className.equalsIgnoreCase("com.jgoodies.looks.plastic.PlasticLookAndFeel")) |
2431 |
| - { |
2432 |
| - PlasticLookAndFeel.setPlasticTheme(new LightGray()); |
2433 |
| - } |
2434 |
| - else if (className.equalsIgnoreCase("com.jgoodies.looks.plastic.Plastic3DLookAndFeel")) |
2435 |
| - { |
2436 |
| - PlasticLookAndFeel.setPlasticTheme(new LightGray()); |
2437 |
| - } |
2438 |
| - else if (className.equalsIgnoreCase("com.jgoodies.looks.plastic.PlasticXPLookAndFeel")) |
2439 |
| - { |
2440 |
| - PlasticLookAndFeel.setPlasticTheme(new LightGray()); |
2441 |
| - } |
2442 |
| - |
2443 |
| - UIManager.setLookAndFeel(realClassName); |
| 2429 | + UIManager.setLookAndFeel(className); |
2444 | 2430 | updateAllComponentTreeUIs();
|
2445 | 2431 | }
|
2446 | 2432 | catch (ClassNotFoundException | InstantiationException | IllegalAccessException |
|
|
0 commit comments