mirror of
https://github.com/1j01/textual-paint.git
synced 2024-11-24 08:44:45 +03:00
Fix menu scrolling down when clicking menu items
This commit is contained in:
parent
652c2138e5
commit
fa4d961fb4
@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Fixed errors when interacting with the command palette (opened by clicking the paint icon in the top left).
|
||||
- Fixed double-acting arrow keys. Before it was moving between buttons of a dialog while also moving the selection on the canvas.
|
||||
- Fixed image files opening as blank white. This bug was introduced in in Textual Paint v0.4.0.
|
||||
- Fixed menu scrolling down when clicking a menu item when the screen was smaller than the menu. In some cases this lead to clicking the wrong menu item, such as Save instead of Open, which is a destructive action.
|
||||
|
||||
## [0.4.0] - 2024-01-11
|
||||
|
||||
|
@ -193,9 +193,8 @@ To preview ANSI art files in file managers like Nautilus, Thunar, Nemo, or Caja,
|
||||
- Due to limitations of the terminal, shortcuts using <kbd>Shift</kbd> or <kbd>Alt</kbd> might not work. Menus are not keyboard navigable, because I can't detect <kbd>Alt</kbd>+<kbd>F</kbd>, etc.
|
||||
- The status bar description can be left blank when selecting a menu item. (I think the `Leave` event can come after closing, once the mouse moves.)
|
||||
- Menu items like Copy/Cut/Paste are not grayed out when inapplicable. Only unimplemented items are grayed out.
|
||||
- Clicking Save As menu item scrolls down menu instead of activating it if there's not enough space to show the whole menu. (It seems to be scrolling the menu item to the top when it becomes focused during the click.)
|
||||
- Worse, clicking Open can scroll down so that Save is under the mouse and trigger Save instead!
|
||||
- Hitting Enter in View Bitmap mode may trigger a menu item while exiting the mode. Menu items ought to be disabled when hidden, and View Bitmap should also prevent the key event from taking other actions if possible.
|
||||
- Entering View Bitmap mode with <kbd>Ctrl</kbd>+<kbd>F</kbd> doesn't close any open menus.
|
||||
- <kbd>Esc</kbd> doesn't close menus.
|
||||
|
||||
### File compatibility
|
||||
- ANSI files (.ans) are treated as UTF-8 when saving and loading, rather than CP437 or Windows-1252 or any other encodings. Unicode is nice and modern terminals support it, but it's not the standard for ANSI files. There isn't really a standard for ANSI files.
|
||||
@ -217,6 +216,8 @@ To preview ANSI art files in file managers like Nautilus, Thunar, Nemo, or Caja,
|
||||
- Extraneous undo states may be created in some cases. In particular, I noticed when undoing/redoing with free-typing mode, the last state had no cursor but was otherwise identical.
|
||||
- Document recovery dialog is shown unnecessarily if the backup file is identical.
|
||||
- Closing dialogs focuses the character input which is undesirable as it prevents typing in the canvas or copying the selection with <kbd>Ctrl</kbd>+<kbd>C</kbd> etc. (You can use <kbd>Esc</kbd> to reset focus.)
|
||||
- Pressing a key to exit View Bitmap mode may cause unwanted side effects.
|
||||
- Pressing a key doesn't exit View Bitmap mode if the character input is focused.
|
||||
|
||||
## Compatibility
|
||||
|
||||
|
@ -230,6 +230,12 @@ class MenuItem(Button):
|
||||
if grayed:
|
||||
self.add_class("grayed")
|
||||
self.can_focus = False
|
||||
|
||||
# Prevent menu scrolling down when clicking a menu item,
|
||||
# potentially clicking a different menu item, such as Save instead of Open (dangerous!)
|
||||
# when the screen is smaller than the menu.
|
||||
self.can_focus = False
|
||||
|
||||
self.action = action
|
||||
self.submenu = submenu
|
||||
self.description = description
|
||||
|
Loading…
Reference in New Issue
Block a user