mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
LibGUI: Add UndoStack::{undo,redo}_action_text()
These return the action_text() for the current undo and redo commands, if available.
This commit is contained in:
@@ -109,4 +109,18 @@ void UndoStack::clear()
|
||||
on_state_change();
|
||||
}
|
||||
|
||||
Optional<String> UndoStack::undo_action_text() const
|
||||
{
|
||||
if (!can_undo())
|
||||
return {};
|
||||
return m_stack[m_stack_index - 1].action_text();
|
||||
}
|
||||
|
||||
Optional<String> UndoStack::redo_action_text() const
|
||||
{
|
||||
if (!can_redo())
|
||||
return {};
|
||||
return m_stack[m_stack_index].action_text();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user