IDEA-180401 Add Background Image feature to general settings

This commit is contained in:
Gregory.Shrago
2017-11-09 20:18:55 +03:00
parent 21c88c18a8
commit 84ad50078e
4 changed files with 35 additions and 5 deletions
@@ -3,7 +3,7 @@
<grid id="cbd77" binding="myRoot" layout-manager="GridLayoutManager" row-count="4" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<xy x="48" y="54" width="612" height="538"/>
<xy x="48" y="54" width="623" height="538"/>
</constraints>
<properties/>
<border type="none"/>
@@ -21,7 +21,7 @@
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Frame"/>
<text value="Empty frame"/>
</properties>
</component>
<component id="c72f5" class="com.intellij.ui.components.JBRadioButton" binding="myEditorRb">
@@ -98,12 +98,14 @@ public class SetBackgroundImageDialog extends DialogWrapper {
}
targetChanged(null);
init();
myEditorPreview.getPanel().setPreferredSize(new Dimension(0, 0));
pack();
}
@NotNull
@Override
protected Action[] createActions() {
return ArrayUtil.append(super.createActions(), new AbstractAction("Clear") {
return ArrayUtil.append(super.createActions(), new AbstractAction("Clear and Close") {
@Override
public void actionPerformed(ActionEvent e) {
doClearAction();
@@ -17,6 +17,8 @@ package com.intellij.ide.ui;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.actions.QuickChangeLookAndFeel;
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.ex.ActionUtil;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ServiceKt;
import com.intellij.openapi.diagnostic.Logger;
@@ -27,6 +29,7 @@ import com.intellij.openapi.editor.colors.ex.DefaultColorSchemesManager;
import com.intellij.openapi.editor.colors.impl.EditorColorsManagerImpl;
import com.intellij.openapi.options.BaseConfigurable;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.registry.Registry;
@@ -135,6 +138,10 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
myComponent.myTransparencyPanel.setVisible(WindowManagerEx.getInstanceEx().isAlphaModeSupported());
myComponent.myBackgroundImageButton.setEnabled(ProjectManager.getInstance().getOpenProjects().length > 0);
myComponent.myBackgroundImageButton.addActionListener(ActionUtil.createActionListener(
"Images.SetBackgroundImage", myComponent.myPanel, ActionPlaces.UNKNOWN));
return myComponent.myPanel;
}
@@ -494,6 +501,7 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
private ColorBlindnessPanel myColorBlindnessPanel;
private JComboBox myAntialiasingInIDE;
private JComboBox myAntialiasingInEditor;
private JButton myBackgroundImageButton;
public MyComponent() {
myOverrideLAFFonts.addActionListener(__ -> updateCombo());
@@ -16,7 +16,7 @@
<properties/>
<border type="none"/>
<children>
<grid id="d992b" layout-manager="GridLayoutManager" row-count="10" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="d992b" layout-manager="GridLayoutManager" row-count="11" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="3" indent="0" use-parent-layout="false"/>
@@ -168,7 +168,7 @@
<grid id="372a6" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -206,6 +206,26 @@
</constraints>
<properties/>
</component>
<grid id="7ea35" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty">
<size top="16" left="0" bottom="0" right="0"/>
</border>
<children>
<component id="123db" class="javax.swing.JButton" binding="myBackgroundImageButton">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Background Image..."/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="26e1c" binding="myTransparencyPanel" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">