mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:38:10 +00:00
TextEditor: Enable/disable undo & redo buttons based on availability (#740)
This commit is contained in:
parent
3e84ea9a53
commit
503fe37eaa
2 changed files with 10 additions and 2 deletions
|
@ -69,6 +69,8 @@ public:
|
|||
bool has_selection() const { return m_selection.is_valid(); }
|
||||
String selected_text() const;
|
||||
void set_selection(const GTextRange&);
|
||||
bool can_undo() const { return m_undo_stack_index < m_undo_stack.size() && !m_undo_stack.is_empty(); }
|
||||
bool can_redo() const { return m_undo_stack_index > 0 && m_undo_stack[m_undo_stack_index - 1].m_undo_vector.size() > 0 && !m_undo_stack.is_empty(); }
|
||||
|
||||
String text() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue