[fixes #969] Use hidden edges checkbox

This commit is contained in:
Sibo Van Gool 2021-07-26 21:07:57 +02:00
parent 145a27d0f5
commit e84f8fd429

View File

@ -81,6 +81,7 @@ public class AppearancePanel extends JPanel {
private Appearance defaultAppearance = null; private Appearance defaultAppearance = null;
private JTabbedPane outsideInsidePane = null; private JTabbedPane outsideInsidePane = null;
private JCheckBox edgesCheckbox = null;
/** /**
* A non-unit that adjusts by a small amount, suitable for values that are * A non-unit that adjusts by a small amount, suitable for values that are
@ -349,15 +350,16 @@ public class AppearancePanel extends JPanel {
// Checkbox to set edges the same as inside/outside // Checkbox to set edges the same as inside/outside
BooleanModel b = new BooleanModel(handler.isEdgesSameAsInside()); BooleanModel b = new BooleanModel(handler.isEdgesSameAsInside());
JCheckBox edges = new JCheckBox(b); edgesCheckbox = new JCheckBox(b);
edges.setText(trans.get(tr_edges)); edgesCheckbox.setText(trans.get(tr_edges));
edges.setToolTipText(trans.get(tr_edges_ttip)); edgesCheckbox.setToolTipText(trans.get(tr_edges_ttip));
add(edges, "wrap"); edgesCheckbox.setVisible(false);
add(edgesCheckbox, "wrap");
edges.addActionListener(new ActionListener() { edgesCheckbox.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
handler.setEdgesSameAsInside(edges.isSelected()); handler.setEdgesSameAsInside(edgesCheckbox.isSelected());
c.fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE); c.fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
} }
}); });
@ -463,6 +465,8 @@ public class AppearancePanel extends JPanel {
c.fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE); c.fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
if (outsideInsidePane != null) if (outsideInsidePane != null)
outsideInsidePane.setEnabledAt(1, !customInside.isSelected()); outsideInsidePane.setEnabledAt(1, !customInside.isSelected());
if (edgesCheckbox != null)
edgesCheckbox.setVisible(!customInside.isSelected());
} }
}); });
panel.add(customInside, "wrap"); panel.add(customInside, "wrap");