IDEA-144668 Ability to disable "Run config" and "test indicator" gutters: UI tweaks

This commit is contained in:
Dmitry Avdeev
2015-12-10 16:12:26 +03:00
parent b2f0bea1b5
commit 4d80e3df9b
2 changed files with 14 additions and 3 deletions
@@ -8,12 +8,19 @@
<properties/>
<border type="none"/>
<children>
<component id="40c88" class="com.intellij.ui.CheckBoxList" binding="myList" custom-create="true">
<scrollpane id="d5ba0" class="com.intellij.ui.components.JBScrollPane">
<constraints>
<grid row="0" 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/>
</component>
<border type="none"/>
<children>
<component id="40c88" class="com.intellij.ui.CheckBoxList" binding="myList" custom-create="true">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
</children>
</grid>
</form>
@@ -155,14 +155,17 @@ public class GutterIconsConfigurable implements Configurable {
@Override
protected JComponent adjustRendering(JComponent rootComponent, JCheckBox checkBox, int index, boolean selected, boolean hasFocus) {
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder());
GutterIconDescriptor descriptor = myList.getItemAt(index);
Icon icon = descriptor == null ? null : descriptor.getIcon();
JLabel label = new JLabel(icon == null ? EmptyIcon.ICON_16 : icon);
label.setOpaque(true);
label.setPreferredSize(new Dimension(25, -1));
label.setHorizontalAlignment(SwingConstants.CENTER);
panel.add(label, BorderLayout.WEST);
panel.add(checkBox, BorderLayout.CENTER);
panel.setBackground(rootComponent.getBackground());
panel.setBackground(getBackground(false));
label.setBackground(getBackground(selected));
checkBox.setBorder(null);
PluginDescriptor pluginDescriptor = myFirstDescriptors.get(descriptor);
@@ -176,5 +179,6 @@ public class GutterIconsConfigurable implements Configurable {
return panel;
}
};
myList.setBorder(BorderFactory.createEmptyBorder());
}
}