woelper / oculante

A fast and simple image viewer / editor for many operating systems
https://github.com/woelper/oculante
MIT License
1.03k stars 45 forks source link

Delete and overwrite operations should ask for a confirmation #348

Open Cosebdd opened 5 months ago

Cosebdd commented 5 months ago

Describe the bug When the user presses Delete or Overwrite in the Edit mode (I'm not sure if there are other destructive operations), these operations fire immediately without any confirmation prompt.

To Reproduce Steps to reproduce the behavior:

  1. Open an image
  2. Press Delete

Or

  1. Open an image
  2. Press E
  3. Press Overwrite

Expected behavior I expect that I will be prompted with a dialog asking for confirmation. This would almost eliminate the possibility of removing/overwriting something by mistake, and if someone doesn't like it there could be a "never ask me again" checkbox.

Desktop (please complete the following information):

woelper commented 5 months ago

This is of course a good suggestion. The UI library I am using makes modal dialogs hard - this is the main reason this is not done. Maybe I can come up with a smart way to do it.

woelper commented 5 months ago

This seems to be an option:

https://lib.rs/crates/egui-modal

Stoppedpuma commented 5 months ago

Depending on how hard this would be to implement, holding to confirm dangerous actions such as overwriting or deleting is a pretty good way of handling accidental actions. Below is a design I've made, the darker red at the left is showing the progress, when the progress bar completes then the action is fulfilled, 1500ms should be a good default time:

1718246940