forked from WerWolv/ImHex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement paste behaviour popup when pasting over one-byte regi…
…ons (WerWolv#2004) ### Problem description This PR implements the feature request described in WerWolv#1995, that describes a problem with the `Paste` vs `Paste all` commands. Users could be thrown off by having `Ctrl+V` act as a simple "Paste over selection", whereas it's generally accepted as a "Paste all". ### Implementation description <!-- Explain what you did to correct the problem --> This PR introduces a new setting, called "Paste behaviour" (under the "Hex Editor" category). This setting has three values: - `Paste over selection`: the current implementation for ImHex. Pastes only over the selection region, in this case pasting only one byte; - `Paste everything`: allows ImHex's `Paste` to behave like a `Paste all` when selecting one-byte regions; - `Ask me next time`: prompts the user for a choice of behaviour (default value). *Note: as users generally use `Paste all` when selecting one-byte regions, calling `Paste` when selecting over two or more bytes is not affected by this change, and will still behave like the usual `Paste` command.* When selecting a one-byte region, and calling the Paste command, users that have not defined a preferred behaviour in the settings will be prompted to choose one, using a brand new popup. The popup also allows the user to cancel, which will not change the settings' value, and will cancel the paste action altogether. ### Screenshots The new popup: ![image](https://github.com/user-attachments/assets/2b0fd532-d4e7-4209-9dd7-8a79278692ea) The new setting: ![image](https://github.com/user-attachments/assets/2644c35e-7332-422e-8fae-ae8ad0507126) ### Additional things I'm not very good with long descriptions, so I'm open to any suggestions regarding the text that is included in the popup! I do think however that we should keep a hint indicating that `Paste all` is always an option, which could solve the issue altogether for very new users. --------- Signed-off-by: BioTheWolff <[email protected]> Co-authored-by: Nik <[email protected]>
- Loading branch information
1 parent
bb99b9a
commit 9375a60
Showing
4 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters