Color chooser dialog defaults to the existing color value being edited

This commit is contained in:
bancika
2021-01-17 09:58:09 +01:00
parent 61202675b8
commit 9af055e4ca
2 changed files with 6 additions and 2 deletions
@@ -3493,7 +3493,11 @@
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>When editing component colors, honor the specified 'alpha' value specified on each color individually in addition to the component-level alpha property</description> <description>When editing component colors, honor the specified 'alpha' value specified on each color individually in addition to the component-level alpha property</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Color chooser dialog defaults to the existing color value being edited</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType> <changeType>IMPROVEMENT</changeType>
<description>Single click to expand and collapse categories in the component tree</description> <description>Single click to expand and collapse categories in the component tree</description>
@@ -105,7 +105,7 @@ public class ColorEditor extends JPanel {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
Color newColor = JColorChooser.showDialog(ColorEditor.this, "Choose Color", getBackground()); Color newColor = JColorChooser.showDialog(ColorEditor.this, "Choose Color", colorLabel.getBackground());
if (newColor != null) { if (newColor != null) {
property.setChanged(true); property.setChanged(true);
property.setValue(new Color(newColor.getRGB())); property.setValue(new Color(newColor.getRGB()));