Skip to content

Commit

Permalink
Merge pull request #56 from konifar/change_vector
Browse files Browse the repository at this point in the history
Change vector option layout
  • Loading branch information
konifar committed Mar 20, 2016
2 parents aa85366 + 8a50e33 commit f47e681
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 40 deletions.
Binary file modified MaterialDesignIconGeneratorPlugin.jar
100755 → 100644
Binary file not shown.
12 changes: 1 addition & 11 deletions src/main/java/com/konifar/material_icon_generator/IconModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class IconModel {
private boolean isVectorType;
private boolean drawable;
private boolean drawableV21;
private boolean drawableNoDpi;

public IconModel(String iconName,
String displayColorName,
Expand All @@ -63,8 +62,7 @@ public IconModel(String iconName,
boolean xxxhdpi,
boolean isVectorType,
boolean drawable,
boolean drawableV21,
boolean drawableNoDpi) {
boolean drawableV21) {
this.iconName = iconName;
this.displayColorName = displayColorName;
this.colorCode = colorCode;
Expand All @@ -79,7 +77,6 @@ public IconModel(String iconName,
this.isVectorType = isVectorType;
this.drawable = drawable;
this.drawableV21 = drawableV21;
this.drawableNoDpi = drawableNoDpi;
}

public String getLocalPath(String size, boolean shouldForcePng) {
Expand Down Expand Up @@ -288,11 +285,4 @@ public void setDrawableV21(boolean drawableV21) {
this.drawableV21 = drawableV21;
}

public boolean isDrawableNoDpi() {
return drawableNoDpi;
}

public void setDrawableNoDpi(boolean drawableNoDpi) {
this.drawableNoDpi = drawableNoDpi;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
</grid>
</constraints>
</vspacer>
<grid id="6575b" binding="panelVector" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="6575b" binding="panelVector" 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="7" column="2" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
Expand All @@ -249,22 +249,6 @@
<text value="drawable-v21"/>
</properties>
</component>
<component id="6ff37" class="javax.swing.JCheckBox" binding="checkBoxDrawableNoDpi">
<constraints>
<grid row="1" 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>
<selected value="false"/>
<text value="drawable-nodpi"/>
</properties>
</component>
<hspacer id="a090a">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="4" height="-1"/>
</grid>
</constraints>
</hspacer>
</children>
</grid>
<component id="12d0b" class="javax.swing.JTextField" binding="textFieldColorCode">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public class MaterialDesignIconGenerateDialog extends DialogWrapper {
private JPanel panelVector;
private JCheckBox checkBoxDrawable;
private JCheckBox checkBoxDrawableV21;
private JCheckBox checkBoxDrawableNoDpi;

public MaterialDesignIconGenerateDialog(@Nullable final Project project) {
super(project, true);
Expand Down Expand Up @@ -182,7 +181,6 @@ private void toggleImageType(boolean shouldVectorSelected) {

checkBoxDrawable.setEnabled(shouldVectorSelected);
checkBoxDrawableV21.setEnabled(shouldVectorSelected);
checkBoxDrawableNoDpi.setEnabled(shouldVectorSelected);

checkBoxHdpi.setEnabled(!shouldVectorSelected);
checkBoxMdpi.setEnabled(!shouldVectorSelected);
Expand Down Expand Up @@ -247,13 +245,6 @@ public void itemStateChanged(ItemEvent event) {
if (model != null) model.setDrawableV21(checkBoxDrawableV21.isSelected());
}
});

checkBoxDrawableNoDpi.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent event) {
if (model != null) model.setDrawableNoDpi(checkBoxDrawableNoDpi.isSelected());
}
});
}

private void initFileName() {
Expand Down Expand Up @@ -440,10 +431,9 @@ private IconModel createModel() {
final boolean isVectorType = radioVector.isSelected();
final boolean drawable = checkBoxDrawable.isSelected();
final boolean drawableV21 = checkBoxDrawableV21.isSelected();
final boolean drawableNoDpi = checkBoxDrawableNoDpi.isSelected();

return new IconModel(iconName, displayColorName, colorCode, dp, fileName, resDir,
mdpi, hdpi, xdpi, xxdpi, xxxdpi, isVectorType, drawable, drawableV21, drawableNoDpi);
mdpi, hdpi, xdpi, xxdpi, xxxdpi, isVectorType, drawable, drawableV21);
}

private void showIconPreview() {
Expand Down Expand Up @@ -533,7 +523,6 @@ private void createIcons() {
if (model.isVectorType()) {
if (model.isDrawable()) createVectorIcon(checkBoxDrawable.getText());
if (model.isDrawableV21()) createVectorIcon(checkBoxDrawableV21.getText());
if (model.isDrawableNoDpi()) createVectorIcon(checkBoxDrawableNoDpi.getText());
} else {
if (model.isMdpi()) createImageIcon(checkBoxMdpi.getText());
if (model.isHdpi()) createImageIcon(checkBoxHdpi.getText());
Expand Down

0 comments on commit f47e681

Please sign in to comment.