diff --git a/src/nostalgia/studio/lib/undostack.cpp b/src/nostalgia/studio/lib/undostack.cpp index dd5bb88e..a4817245 100644 --- a/src/nostalgia/studio/lib/undostack.cpp +++ b/src/nostalgia/studio/lib/undostack.cpp @@ -19,12 +19,14 @@ void UndoStack::redo() noexcept { if (m_stackIdx < m_stack.size()) { m_stack[m_stackIdx++]->redo(); } + redoTriggered.emit(); } void UndoStack::undo() noexcept { if (m_stackIdx) { m_stack[--m_stackIdx]->undo(); } + undoTriggered.emit(); } } \ No newline at end of file diff --git a/src/nostalgia/studio/lib/undostack.hpp b/src/nostalgia/studio/lib/undostack.hpp index c08ae316..71bc6426 100644 --- a/src/nostalgia/studio/lib/undostack.hpp +++ b/src/nostalgia/studio/lib/undostack.hpp @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -30,14 +31,17 @@ class UndoStack { void undo() noexcept; [[nodiscard]] - constexpr bool canRedo() noexcept { + constexpr bool canRedo() const noexcept { return m_stackIdx < m_stack.size(); } [[nodiscard]] - constexpr bool canUndo() noexcept { + constexpr bool canUndo() const noexcept { return m_stackIdx; } + + ox::Signal redoTriggered; + ox::Signal undoTriggered; }; } \ No newline at end of file