diff --git a/platform/platform-impl/src/com/intellij/ide/customize/AbstractCustomizeWizardStep.java b/platform/platform-impl/src/com/intellij/ide/customize/AbstractCustomizeWizardStep.java index 3df11563b30a..6844ed5bab25 100644 --- a/platform/platform-impl/src/com/intellij/ide/customize/AbstractCustomizeWizardStep.java +++ b/platform/platform-impl/src/com/intellij/ide/customize/AbstractCustomizeWizardStep.java @@ -37,7 +37,7 @@ public abstract class AbstractCustomizeWizardStep extends JPanel { @NotNull protected static Color getSelectionBackground() { - return ColorUtil.mix(UIUtil.getListSelectionBackground(), UIUtil.getLabelBackground(), .75); + return ColorUtil.mix(UIUtil.getListSelectionBackground(), UIUtil.getLabelBackground(), UIUtil.isUnderDarcula() ? .5 : .75); } protected static JPanel createBigButtonPanel(LayoutManager layout, final JToggleButton anchorButton, final Runnable action) { diff --git a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java index 203e0418f6de..9afc0ab9f163 100644 --- a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java +++ b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java @@ -32,6 +32,8 @@ import java.util.ArrayList; import java.util.List; public class CustomizeIDEWizardDialog extends DialogWrapper implements ActionListener { + private static final String BUTTONS = "BUTTONS"; + private static final String NOBUTTONS = "NOBUTTONS"; private final JButton mySkipButton = new JButton("Skip All and Set Defaults"); private final JButton myBackButton = new JButton("Back"); private final JButton myNextButton = new JButton("Next"); @@ -42,6 +44,8 @@ public class CustomizeIDEWizardDialog extends DialogWrapper implements ActionLis private final JLabel myNavigationLabel = new JLabel(); private final JLabel myHeaderLabel = new JLabel(); private final JLabel myFooterLabel = new JLabel(); + private final CardLayout myButtonWrapperLayout = new CardLayout(); + private final JPanel myButtonWrapper = new JPanel(myButtonWrapperLayout); private JPanel myContentPanel; public CustomizeIDEWizardDialog() { @@ -99,23 +103,30 @@ public class CustomizeIDEWizardDialog extends DialogWrapper implements ActionLis @Override protected JComponent createSouthPanel() { - final JPanel result = new JPanel(new GridBagLayout()); + final JPanel buttonPanel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets.right = 5; gbc.fill = GridBagConstraints.BOTH; gbc.gridx = 0; gbc.gridy = 0; - result.add(mySkipButton, gbc); + buttonPanel.add(mySkipButton, gbc); gbc.gridx++; - result.add(myBackButton, gbc); + buttonPanel.add(myBackButton, gbc); gbc.gridx++; gbc.weightx = 1; - result.add(Box.createHorizontalGlue(), gbc); + buttonPanel.add(Box.createHorizontalGlue(), gbc); gbc.gridx++; gbc.weightx = 0; - result.add(myNextButton, gbc); - result.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0)); - return result; + buttonPanel.add(myNextButton, gbc); + buttonPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0)); + myButtonWrapper.add(buttonPanel, BUTTONS); + myButtonWrapper.add(new JLabel(), NOBUTTONS); + myButtonWrapperLayout.show(myButtonWrapper, BUTTONS); + return myButtonWrapper; + } + + void setButtonsVisible(boolean visible) { + myButtonWrapperLayout.show(myButtonWrapper, visible ? BUTTONS : NOBUTTONS); } @Override diff --git a/platform/platform-impl/src/com/intellij/ide/customize/CustomizePluginsStepPanel.java b/platform/platform-impl/src/com/intellij/ide/customize/CustomizePluginsStepPanel.java index c591f78b6053..5fa3bbcbbd25 100644 --- a/platform/platform-impl/src/com/intellij/ide/customize/CustomizePluginsStepPanel.java +++ b/platform/platform-impl/src/com/intellij/ide/customize/CustomizePluginsStepPanel.java @@ -16,6 +16,7 @@ package com.intellij.ide.customize; import com.intellij.openapi.application.ApplicationNamesInfo; +import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.ui.VerticalFlowLayout; import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.Pair; @@ -162,6 +163,14 @@ public class CustomizePluginsStepPanel extends AbstractCustomizeWizardStep imple if (CUSTOMIZE_COMMAND.equals(command)) { myCustomizePanel.update(group); myCardLayout.show(this, CUSTOMIZE); + setButtonsVisible(false); + } + } + + private void setButtonsVisible(boolean visible) { + DialogWrapper window = DialogWrapper.findInstance(this); + if (window instanceof CustomizeIDEWizardDialog) { + ((CustomizeIDEWizardDialog)window).setButtonsVisible(visible); } } @@ -225,15 +234,21 @@ public class CustomizePluginsStepPanel extends AbstractCustomizeWizardStep imple setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, GAP, true, false)); add(myTitleLabel); add(myContentPanel); - JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 25, 5)); - buttonPanel.add(mySaveButton); - buttonPanel.add(new LinkLabel("Enable All", null, this, "enable")); - buttonPanel.add(new LinkLabel("Disable All", null, this, "disable")); + JPanel buttonPanel = new JPanel(new GridBagLayout()); + GridBagConstraints gbc = new GridBagConstraints(); + gbc.insets.right = 25; + gbc.gridy = 0; + buttonPanel.add(mySaveButton, gbc); + buttonPanel.add(new LinkLabel("Enable All", null, this, "enable"), gbc); + buttonPanel.add(new LinkLabel("Disable All", null, this, "disable"), gbc); + gbc.weightx = 1; + buttonPanel.add(Box.createHorizontalGlue(), gbc); add(buttonPanel); mySaveButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myCardLayout.show(CustomizePluginsStepPanel.this, MAIN); + setButtonsVisible(true); } }); }