keep defaults for variants separate

This commit is contained in:
Branislav Stojkovic
2019-01-07 23:39:36 +01:00
parent 405f8367df
commit a4639d3f1a
7 changed files with 43 additions and 39 deletions
Binary file not shown.
Binary file not shown.
@@ -125,9 +125,11 @@ public class ComponentButtonFactory {
plugInPort.setNewComponentTypeSlot(componentType, template);
}
});
String defaultVariant = plugInPort.getDefaultTemplate(componentType.getCategory(), componentType.getName());
JLabel label = new JLabel(template.isDefaultFlag() ? IconLoader.PinGreen.getIcon() : IconLoader.PinGrey.getIcon());
label.setToolTipText(template.isDefaultFlag() ? "Remove default variant" : "Set default variant");
JLabel label = new JLabel(template.getName().equals(defaultVariant) ? IconLoader.PinGreen.getIcon() : IconLoader.PinGrey.getIcon());
label.setToolTipText(template.getName().equals(defaultVariant) ? "Remove default variant" : "Set default variant");
label.addMouseListener(new MouseAdapter() {
@Override
@@ -138,8 +140,7 @@ public class ComponentButtonFactory {
JPopupMenu m = (JPopupMenu) c;
m.setVisible(false);
}
plugInPort.setTemplateDefault(componentType.getCategory(), componentType.getName(), template.getName(),
!template.isDefaultFlag());
plugInPort.setTemplateDefault(componentType.getCategory(), componentType.getName(), template.getName());
e.consume();
}
});
+5 -1
View File
@@ -2104,7 +2104,7 @@
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Made it possible for DIYLC to come with predefined component variants in addition to user-specific variants</description>
<description>DIYLC now comes with predefined component variants out-of-the box, in addition to user-specific variants</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
@@ -2113,6 +2113,10 @@
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>Inlude Themes (under Config menu) in the Windows installer version</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>Covered humbucker pickup throwing errors when rotated</description>
</org.diylc.appframework.update.Change>
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>