mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CPP-3150 Warn users about Vim plugin on Welcome screen
* better warning layout
This commit is contained in:
+20
-5
@@ -36,6 +36,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.CompoundBorder;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -98,12 +99,10 @@ public class CustomizeFeaturedPluginsStepPanel extends AbstractCustomizeWizardSt
|
||||
JLabel descriptionLabel = createHTMLLabel("<i>" + description + "</i>");
|
||||
JLabel warningLabel = null;
|
||||
if (isVIM) {
|
||||
warningLabel = createHTMLLabel("This plugin enables Vim-keymap and 'insert' mode for editing. " +
|
||||
"If you are not familiar with Vim, it's not recommended to install it.");
|
||||
warningLabel = createHTMLLabel("Enables Vim-keymap and 'insert' mode for editing. " +
|
||||
"Not recommended if you are unfamiliar with Vim.");
|
||||
|
||||
if (SystemInfo.isMac) UIUtil.applyStyle(UIUtil.ComponentStyle.SMALL, warningLabel);
|
||||
warningLabel.setBackground(new JBColor(ColorUtil.fromHex("F6F199"), ColorUtil.fromHex("52503A")));
|
||||
warningLabel.setOpaque(true);
|
||||
}
|
||||
|
||||
final CardLayout wrapperLayout = new CardLayout();
|
||||
@@ -229,7 +228,23 @@ public class CustomizeFeaturedPluginsStepPanel extends AbstractCustomizeWizardSt
|
||||
gbc.weighty = 1;
|
||||
groupPanel.add(Box.createVerticalGlue(), gbc);
|
||||
gbc.weighty = 0;
|
||||
if (warningLabel != null) groupPanel.add(warningLabel, gbc);
|
||||
if (warningLabel != null) {
|
||||
Insets insetsBefore = gbc.insets;
|
||||
gbc.insets = new Insets(0, -10, SMALL_GAP, -10);
|
||||
JPanel warningPanel = new JPanel(new BorderLayout()) {
|
||||
@Override
|
||||
public Color getBackground() {
|
||||
return new JBColor(ColorUtil.fromHex("F6F199"), ColorUtil.fromHex("52503A"));
|
||||
}
|
||||
};
|
||||
warningPanel.setBorder(new EmptyBorder(5, 10, 5, 10));
|
||||
warningPanel.add(warningLabel);
|
||||
|
||||
groupPanel.add(warningPanel, gbc);
|
||||
gbc.insets = insetsBefore;
|
||||
}
|
||||
|
||||
gbc.insets.bottom = 0;
|
||||
groupPanel.add(buttonWrapper, gbc);
|
||||
gridPanel.add(groupPanel);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public class PluginGroups {
|
||||
}
|
||||
|
||||
protected static void addVimPlugin(Map<String, String> featuredPlugins) {
|
||||
featuredPlugins.put("IdeaVIM", "Editor:Emulates Vim behavior and shortcuts:" + IDEA_VIM_PLUGIN_ID);
|
||||
featuredPlugins.put("IdeaVIM", "Editor:Emulates Vim editor:" + IDEA_VIM_PLUGIN_ID);
|
||||
}
|
||||
|
||||
protected static void addLuaPlugin(Map<String, String> featuredPlugins) {
|
||||
|
||||
Reference in New Issue
Block a user