diff --git a/src/main/java/com/github/creme332/controller/console/SideMenuController.java b/src/main/java/com/github/creme332/controller/console/SideMenuController.java index 7ce9754d..1a15cd8a 100644 --- a/src/main/java/com/github/creme332/controller/console/SideMenuController.java +++ b/src/main/java/com/github/creme332/controller/console/SideMenuController.java @@ -63,7 +63,7 @@ private void initializeButtonListeners(AppState app) { int confirmation = JOptionPane.showConfirmDialog(null, "Do you want to clear the current canvas? This action is irreversible.", "Clear canvas", - JOptionPane.OK_CANCEL_OPTION); + JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if (confirmation == JOptionPane.YES_OPTION) { canvasModel.getShapeManager().reset(); @@ -119,16 +119,23 @@ public void mousePressed(MouseEvent e) { // Reset button sidebar.getResetButton().addActionListener(e -> { - // Reset guidelines checkbox and model - if (sidebar.getGridLinesCheckBox().isSelected()) { - sidebar.getGridLinesCheckBox().setSelected(false); - canvasModel.setGuidelinesEnabled(true); - } + int confirmation = JOptionPane.showConfirmDialog(null, + "Do you want to reset the canvas settings to its default values? This action is irreversible.", + "Reset canvas settings", + JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); - // Reset axes checkbox and model - if (sidebar.getAxesCheckBox().isSelected()) { - sidebar.getAxesCheckBox().setSelected(false); - canvasModel.setAxesVisible(true); + if (confirmation == JOptionPane.YES_OPTION) { + // Reset guidelines checkbox and model + if (sidebar.getGridLinesCheckBox().isSelected()) { + sidebar.getGridLinesCheckBox().setSelected(false); + canvasModel.setGuidelinesEnabled(true); + } + + // Reset axes checkbox and model + if (sidebar.getAxesCheckBox().isSelected()) { + sidebar.getAxesCheckBox().setSelected(false); + canvasModel.setAxesVisible(true); + } } }); }