Opened 13 years ago
Closed 13 years ago
#7327 closed enhancement (fixed)
[Patch] show hint in undo-menu which action will be undone (from event stack)
Reported by: | dieterdreist | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | undo stack buffer menu | Cc: |
Description
It would improve usability if the "undo" and "redo" text from the "edit" menu would be extended by the actual action that will be undone or redone (e.g. "undo delete node" instead of "undo"). This information is already available in the undo-buffer, but displaying it in the menu would improve the user experience and avoid some errateous undos.
Attachments (1)
Change History (8)
comment:1 by , 13 years ago
by , 13 years ago
Attachment: | 7327.patch added |
---|
follow-up: 3 comment:2 by , 13 years ago
Summary: | show hint in undo-menu which action will be undone (from event stack) → [Patch] show hint in undo-menu which action will be undone (from event stack) |
---|
It was not too difficult to implement. Just needed to add the menu items as CommandQueueListener
to UndoRedoHandler
.
Currently each Command
must provide a JLabel getDescription()
method. I'd consider it better to request String getDescriptionText()
and ImageIcon getDescriptionIcon()
instead as this allows to use the data in other places as well without doing quirks (cf. String Command.getDescrpitionText()
in patch).
comment:3 by , 13 years ago
Replying to simon04:
Currently each
Command
must provide aJLabel getDescription()
method. I'd consider it better to requestString getDescriptionText()
andImageIcon getDescriptionIcon()
instead as this allows to use the data in other places as well without doing quirks (cf.String Command.getDescrpitionText()
in patch).
Good idea. You can remove old method MutableTreeNode description()
(and depricate JLabel getDescription()
).
comment:4 by , 13 years ago
It is simpler than I thought :) Will it fit OK in menu on small screens?
follow-up: 6 comment:5 by , 13 years ago
maybe it won't fit. Would it be possible to get this as tooltip? (the overlay displayed besides the mouse cursor if you remain longer over a menu item or button. It could substitute the current tooltip "undo the last action" with "undo xyz" where xyz is the last action.
comment:6 by , 13 years ago
Replying to dieterdreist:
maybe it won't fit. Would it be possible to get this as tooltip? (the overlay displayed besides the mouse cursor if you remain longer over a menu item or button. It could substitute the current tooltip "undo the last action" with "undo xyz" where xyz is the last action.
That is easily possible.
For the menu text, we could truncate after e.g. 3 words. Does this work with I18N, especially with right-to-left-languages?
It is hard to implement, beacuse menu items are constructed at startup...