提交 deeeb82d 编写于 作者: H helio

add keymap ui replacement

上级 7a981ae9
......@@ -1713,6 +1713,7 @@ public final class MTConfig implements PersistentStateComponent<MTConfig>,
hashMap.put("upperCaseTabs", upperCaseTabs);
hashMap.put("useMaterialFont", useMaterialFont2);
hashMap.put("useMaterialWallpapers", useMaterialWallpapers);
hashMap.put("useProjectFrame", useProjectFrame);
hashMap.put("userId", userId);
hashMap.put("version", version);
......
......@@ -30,6 +30,7 @@ import com.intellij.codeInsight.lookup.impl.LookupCellRenderer;
import com.intellij.ide.actions.Switcher;
import com.intellij.ide.navigationToolbar.ui.NavBarUIManager;
import com.intellij.openapi.actionSystem.ex.ActionButtonLook;
import com.intellij.openapi.keymap.impl.ui.MouseShortcutPanel;
import com.intellij.ui.Gray;
import com.intellij.ui.JBColor;
import com.intellij.ui.SimpleTextAttributes;
......@@ -70,6 +71,7 @@ public enum UIReplacer {
patchOnMouseOver();
patchAndroid();
patchAttributes();
patchKeymap();
} catch (final IllegalAccessException | NoSuchFieldException e) {
e.printStackTrace();
}
......@@ -79,6 +81,12 @@ public enum UIReplacer {
StaticPatcher.setFinalStatic(Switcher.class, "ON_MOUSE_OVER_BG_COLOR", UIUtil.getListSelectionBackground(true));
}
private static void patchKeymap() throws NoSuchFieldException, IllegalAccessException {
StaticPatcher.setFinalStatic(MouseShortcutPanel.class, "BACKGROUND", MTUI.Panel.getSecondaryBackground());
StaticPatcher.setFinalStatic(MouseShortcutPanel.class, "BORDER", MTUI.Panel.getSecondaryBackground());
StaticPatcher.setFinalStatic(MouseShortcutPanel.class, "FOREGROUND", MTUI.Panel.getForeground());
}
private static void patchGrays() throws NoSuchFieldException, IllegalAccessException {
// Replace Gray with a clear and transparent color
final Gray gray = Gray._85;
......@@ -197,8 +205,7 @@ public enum UIReplacer {
* Patch the Completion Popup background to match the currently selected
* theme.
*/
@SuppressWarnings({"HardCodedStringLiteral",
"StringConcatenation"})
@SuppressWarnings("HardCodedStringLiteral")
static void patchCompletionPopup() {
final Color autoCompleteBackground = MTUI.Panel.getSecondaryBackground();
try {
......
......@@ -41,6 +41,8 @@ public enum AccentResources {
@NonNls
public static final Set<String> ACCENT_RESOURCES = Collections.unmodifiableSet(
Sets.newHashSet(
"ActionButton.pressedBackground",
"ActionButton.pressedBorderColor",
"Button.darcula.defaultFocusedOutlineColor", // deprecated
"Button.darcula.focusedOutlineColor", // deprecated
"Button.darcula.outlineDefaultEndColor", // deprecated
......@@ -156,8 +158,6 @@ public enum AccentResources {
@NonNls
public static final Set<String> ACCENT_TRANSPARENT_RESOURCES = Collections.unmodifiableSet(
Sets.newHashSet(
"ActionButton.pressedBackground",
"ActionButton.pressedBorderColor",
"ActionButton.focusedBorderColor",
"ActionButton.hoverBackground",
"ActionButton.hoverBorderColor",
......
......@@ -104,6 +104,9 @@ public final class MTWizardOtherOptionsPanel extends AbstractCustomizeWizardStep
// Wallpapers
materialWallpapersCheckbox.setSelected(config.isUseMaterialWallpapers());
// Project Frame
projectFrameCheckbox.setSelected(config.isUseProjectFrame());
}
@Override
......@@ -177,14 +180,14 @@ public final class MTWizardOtherOptionsPanel extends AbstractCustomizeWizardStep
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
// Generated using JFormDesigner non-commercial license
ResourceBundle bundle = ResourceBundle.getBundle("messages.MTWizardBundle");
final ResourceBundle bundle = ResourceBundle.getBundle("messages.MTWizardBundle");
scrollPane = new JBScrollPane();
content = new JPanel();
tabsPanel = new JPanel();
JLabel tabHeight = new JLabel();
final JLabel tabHeight = new JLabel();
tabHeightSpinner = new JSpinner();
tabHeightDesc = new JTextPane();
JLabel thicknessLabel = new JLabel();
final JLabel thicknessLabel = new JLabel();
highlightSpinner = new JSpinner();
thicknessDesc = new JTextPane();
uppercaseTabsCheckbox = new JCheckBox();
......@@ -207,7 +210,7 @@ public final class MTWizardOtherOptionsPanel extends AbstractCustomizeWizardStep
compactMenusDesc3 = new JTextPane();
label1 = new JLabel();
projectPanel = new JPanel();
JLabel sidebarHeight = new JLabel();
final JLabel sidebarHeight = new JLabel();
sidebarHeightSpinner = new JSpinner();
sidebarHeightDesc = new JTextPane();
selectedIndicatorLabel = new JLabel();
......@@ -228,11 +231,11 @@ public final class MTWizardOtherOptionsPanel extends AbstractCustomizeWizardStep
"fillx,novisualpadding,hidemode 3,align left top",
// columns
"[325,grow,fill]" +
"[grow,fill]",
"[grow,fill]",
// rows
"[]" +
"[]" +
"[]"));
"[]" +
"[]"));
//======== tabsPanel ========
{
......@@ -243,11 +246,11 @@ public final class MTWizardOtherOptionsPanel extends AbstractCustomizeWizardStep
"[grow,left]",
// rows
"[20,fill]0" +
"[]" +
"[]0" +
"[]" +
"[]0" +
"[]"));
"[]" +
"[]0" +
"[]" +
"[]0" +
"[]"));
//---- tabHeight ----
tabHeight.setHorizontalTextPosition(SwingConstants.LEADING);
......@@ -307,11 +310,11 @@ public final class MTWizardOtherOptionsPanel extends AbstractCustomizeWizardStep
"[grow,left]",
// rows
"0[18,fill]0" +
"[]" +
"[]0" +
"[]0" +
"[17]0" +
"[]"));
"[]" +
"[]0" +
"[]0" +
"[17]0" +
"[]"));
//---- fileColorsCheckbox ----
fileColorsCheckbox.setText(bundle.getString("MTWizardOtherOptionsPanel.fileColorsCheckbox.text"));
......@@ -362,13 +365,13 @@ public final class MTWizardOtherOptionsPanel extends AbstractCustomizeWizardStep
"[grow,left]",
// rows
"0[18,fill]0" +
"[]" +
"[]0" +
"[]" +
"[]0" +
"[]" +
"[]0" +
"[]"));
"[]" +
"[]0" +
"[]" +
"[]0" +
"[]" +
"[]0" +
"[]"));
//---- compactStatusCheckbox ----
compactStatusCheckbox.setText(bundle.getString("MTWizardOtherOptionsPanel.compactStatusCheckbox.text"));
......@@ -435,9 +438,9 @@ public final class MTWizardOtherOptionsPanel extends AbstractCustomizeWizardStep
"[grow,left]",
// rows
"[20,fill]0" +
"[]0" +
"[]0" +
"[]"));
"[]0" +
"[]0" +
"[]"));
//---- sidebarHeight ----
sidebarHeight.setHorizontalTextPosition(SwingConstants.LEADING);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册