mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:57:45 +00:00
LibGUI: Remember modified state on undo/redo actions
This commit is contained in:
parent
67537bfc80
commit
928f16d360
5 changed files with 39 additions and 12 deletions
|
@ -19,13 +19,16 @@ public:
|
|||
void push(NonnullOwnPtr<Command>&&);
|
||||
|
||||
bool can_undo() const { return m_stack_index < m_stack.size() && !m_stack.is_empty(); }
|
||||
bool can_redo() const { return m_stack_index > 0 && !m_stack.is_empty(); }
|
||||
bool can_redo() const { return m_stack_index > 0 && !m_stack.is_empty() && m_stack[m_stack_index - 1].m_undo_vector.size() > 0; }
|
||||
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
void finalize_current_combo();
|
||||
|
||||
void set_current_unmodified();
|
||||
bool is_current_modified() const;
|
||||
|
||||
void clear();
|
||||
|
||||
private:
|
||||
|
@ -35,6 +38,7 @@ private:
|
|||
|
||||
NonnullOwnPtrVector<UndoCommandsContainer> m_stack;
|
||||
size_t m_stack_index { 0 };
|
||||
Optional<size_t> m_clean_index;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue