From 8ae30a1a56131ea5104d8b1acccf0dcac6802d85 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Tue, 6 Mar 2018 21:30:41 +0300 Subject: [PATCH] Ensure we initialize default theme name in static fields --- .../ide/customize/CustomizeUIThemeStepPanel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeUIThemeStepPanel.java b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeUIThemeStepPanel.java index 11d381335c55..3fed4e328a75 100644 --- a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeUIThemeStepPanel.java +++ b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeUIThemeStepPanel.java @@ -66,7 +66,6 @@ public class CustomizeUIThemeStepPanel extends AbstractCustomizeWizardStep { LafManagerImpl.useIntelliJInsteadOfAqua() ? "Light" : "IntelliJ", "IntelliJ", IntelliJLaf.class.getName()); protected static final ThemeInfo GTK = new ThemeInfo("GTK+", "GTK", "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); - private boolean myInitial = true; private final boolean myColumnMode; private final JLabel myPreviewLabel; private final Set myThemes = new LinkedHashSet<>(); @@ -112,8 +111,11 @@ public class CustomizeUIThemeStepPanel extends AbstractCustomizeWizardStep { wrapperPanel.add(myPreviewLabel); add(wrapperPanel, BorderLayout.CENTER); } + //Static fields initialization. At this point there is no parent window + applyLaf(myDefaultTheme, this); + //Actual UI initialization + //noinspection SSBasedInspection SwingUtilities.invokeLater(() -> applyLaf(myDefaultTheme, this)); - myInitial = false; } protected void initThemes(Collection result) { @@ -190,9 +192,7 @@ public class CustomizeUIThemeStepPanel extends AbstractCustomizeWizardStep { UIManager.setLookAndFeel(info.getClassName()); LafManagerImpl.updateForDarcula(UIUtil.isUnderDarcula()); String className = info.getClassName(); - if (!myInitial) { - WelcomeWizardUtil.setWizardLAF(className); - } + WelcomeWizardUtil.setWizardLAF(className); Window window = SwingUtilities.getWindowAncestor(component); if (window != null) { if (SystemInfo.isMac) {