summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/UndoStack.h
AgeCommit message (Collapse)Author
2021-05-08LibGUI: Add UndoStack::{undo,redo}_action_text()Andreas Kling
These return the action_text() for the current undo and redo commands, if available.
2021-05-08LibGUI: Remove UndoStack's automatic command combo'ingAndreas Kling
UndoStack will now merge adjacent commands *if they want to be merged* instead of bundling everything you push onto it until you tell it to "finalize the combo." This uses less memory and gives applications full control over how their undo stacks end up. :^)
2021-05-08LibGUI: Add missing <AK/Function.h> includeMaciej Zygmanowski
2021-05-08LibGUI: Add UndoStack::on_state_change hookAndreas Kling
This will allow clients to react to the undo stack changing state. It's invoked when the stack or clean index are changed.
2021-05-08LibGUI: Reverse internal direction of GUI::UndoStackAndreas Kling
The undo stack was very difficult to understand as it grew by adding new undo commands to the front of the internal vector. This meant we had to keep updating indices as the stack grew and shrank. This patch makes the internal vector grow by appending instead.
2021-05-08Revert "LibGUI: Fix undo stack reporting wrong modified state"Andreas Kling
This reverts commit 0b7e19e2bb34cceb340607f0b7f76b338d78767e. Let's reverse the direction of the undo stack to fix the confusion.
2021-05-08LibGUI: Fix undo stack reporting wrong modified stateCarlos César Neves Enumo
Since the `redo` action never goes back to `index: 0`, we have to mark the clean index as being the current non-empty index for the undo/redo navigation to work properly. The problem is that if we never `undo`, the stack index stays at zero, which is the empty container waiting for commands. In that situation, if we save the document, it registers the clean index as being 1 (the non-empty index) but because the stack index has never left zero, the document was being reported as modified, being out of sync with the window modified state.
2021-05-08LibGUI: Rename UndoStack internalsAndreas Kling
Since we keep a stack of command combos, let's call entries on the stack "Combo" instead of "UndoCommandsContainer". And since it has a vector of commands, let's call it "commands" instead of "m_undo_vector".
2021-05-06LibGUI: Remember modified state on undo/redo actionsCarlos César Neves Enumo
2021-05-06LibGUI: Clear undo stack when opening a new documentCarlos César Neves Enumo
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling