Commit dialog. Correct minimum size.

This commit is contained in:
Evgeny Zakrevsky
2012-04-11 14:41:03 +04:00
parent 41c6eabad4
commit ef315fe2ea
3 changed files with 127 additions and 147 deletions
@@ -251,7 +251,7 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar {
}
if (mySecondaryActions.getChildrenCount() > 0) {
mySecondaryActionsButton = new SecondaryButton(mySecondaryActions, myPresentationFactory.getPresentation(mySecondaryActions), myPlace, getMinimumButtonSize());
mySecondaryActionsButton = new ActionButton(mySecondaryActions, myPresentationFactory.getPresentation(mySecondaryActions), myPlace, getMinimumButtonSize());
mySecondaryActionsButton.setNoIconsInPopup(true);
add(mySecondaryActionsButton);
}
@@ -678,7 +678,8 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar {
public Dimension getMinimumSize() {
if (myLayoutPolicy == AUTO_LAYOUT_POLICY) {
return new Dimension(myAutoPopupIcon.getIconWidth(), myMinimumButtonSize.height);
final Insets i = getInsets();
return new Dimension(myAutoPopupIcon.getIconWidth() + i.left + i.right, myMinimumButtonSize.height + i.top + i.bottom);
}
else {
return super.getMinimumSize();
@@ -1088,26 +1089,6 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar {
mySecondaryActions.getTemplatePresentation().setDescription(secondaryActionsTooltip);
}
private static class SecondaryButton extends ActionButton {
private SecondaryButton(AnAction action, Presentation presentation, String place, @NotNull Dimension minimumSize) {
super(action, presentation, place, minimumSize);
}
@Override
protected void paintButtonLook(Graphics g) {
final Color bright = new Color(255, 255, 255, 200);
g.setColor(bright);
int padding = 3;
g.drawLine(0, padding, 0, getHeight() - padding - 1);
final Color dark = new Color(64, 64, 64, 110);
g.setColor(dark);
g.drawLine(1, padding, 1, getHeight() - padding - 1);
super.paintButtonLook(g);
}
}
public List<SwitchTarget> getTargets(boolean onlyVisible, boolean originalProvider) {
ArrayList<SwitchTarget> result = new ArrayList<SwitchTarget>();
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.openapi.vcs.changes.ui.CommitLegendPanel">
<grid id="27dc6" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="2" 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>
<xy x="20" y="20" width="338" height="357"/>
<xy x="20" y="20" width="200" height="222"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="44206" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="44206" layout-manager="GridLayoutManager" row-count="3" column-count="3" 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="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -43,63 +43,9 @@
<text resource-bundle="messages/VcsBundle" key="commit.legend.included"/>
</properties>
</component>
<component id="97520" class="javax.swing.JSeparator">
<constraints>
<grid row="5" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="b8400" class="javax.swing.JLabel" binding="myModifiedShown">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="e3e31" class="javax.swing.JLabel" binding="myModifiedIncluded">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="d282c" class="javax.swing.JLabel" binding="myNewShown">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="6b5fd" class="javax.swing.JLabel" binding="myNewIncluded">
<constraints>
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="4d448" class="javax.swing.JLabel" binding="myDeletedShown">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="4836c" class="javax.swing.JLabel" binding="myDeletedIncluded">
<constraints>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="bf4d3" class="javax.swing.JLabel" binding="myTotalShown">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="1"/>
@@ -107,76 +53,16 @@
</component>
<component id="9bacb" class="javax.swing.JLabel" binding="myTotalIncluded">
<constraints>
<grid row="6" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<grid id="b2e92" binding="myModifiedPanel" 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="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="a7590" class="javax.swing.JLabel" binding="myModifiedLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.modified"/>
</properties>
</component>
</children>
</grid>
<grid id="b6a5f" binding="myNewPanel" 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="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="5d89e" class="javax.swing.JLabel" binding="myNewLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.new"/>
</properties>
</component>
</children>
</grid>
<grid id="db816" binding="myDeletedPanel" 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="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="1f74b" class="javax.swing.JLabel" binding="myDeletedLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.deleted"/>
</properties>
</component>
</children>
</grid>
<component id="caf79" class="javax.swing.JSeparator">
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<grid id="2e2f4" 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="6" 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="2" 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"/>
@@ -191,8 +77,125 @@
</component>
</children>
</grid>
<grid id="1c31e" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="0" bottom="10" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="b8400" class="javax.swing.JLabel" binding="myModifiedShown">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="e3e31" class="javax.swing.JLabel" binding="myModifiedIncluded">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="d282c" class="javax.swing.JLabel" binding="myNewShown">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="6b5fd" class="javax.swing.JLabel" binding="myNewIncluded">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="4d448" class="javax.swing.JLabel" binding="myDeletedShown">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="4836c" class="javax.swing.JLabel" binding="myDeletedIncluded">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<grid id="b2e92" binding="myModifiedPanel" 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="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="a7590" class="javax.swing.JLabel" binding="myModifiedLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.modified"/>
</properties>
</component>
</children>
</grid>
<grid id="b6a5f" binding="myNewPanel" 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="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="5d89e" class="javax.swing.JLabel" binding="myNewLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.new"/>
</properties>
</component>
</children>
</grid>
<grid id="db816" binding="myDeletedPanel" 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="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="1f74b" class="javax.swing.JLabel" binding="myDeletedLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.deleted"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</children>
</grid>
<vspacer id="b1f37">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
</form>
@@ -229,11 +229,7 @@ public class MultipleChangeListBrowser extends ChangesBrowser {
public ChangeListChooser(List<? extends ChangeList> lists) {
super(new BorderLayout(4, 2));
myChooser = new JComboBox() {
public Dimension getMinimumSize() {
return new Dimension(0, 0);
}
};
myChooser = new JComboBox();
myChooser.setRenderer(new HtmlListCellRenderer<LocalChangeList>(myChooser.getRenderer()) {
@Override
protected void doCustomize(JList list, LocalChangeList value, int index, boolean selected, boolean hasFocus) {