diff --git a/extern/imgui_patched/imgui.h b/extern/imgui_patched/imgui.h index e9ccea9b..3d600ea2 100644 --- a/extern/imgui_patched/imgui.h +++ b/extern/imgui_patched/imgui.h @@ -1042,7 +1042,7 @@ enum ImGuiInputTextFlags_ ImGuiInputTextFlags_AlwaysOverwrite = 1 << 13, // Overwrite mode ImGuiInputTextFlags_ReadOnly = 1 << 14, // Read-only mode ImGuiInputTextFlags_Password = 1 << 15, // Password mode, display all characters as '*' - ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). + ImGuiInputTextFlags_UndoRedo = 1 << 16, // Enable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input) ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) ImGuiInputTextFlags_CallbackEdit = 1 << 19 // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) diff --git a/extern/imgui_patched/imgui_widgets.cpp b/extern/imgui_patched/imgui_widgets.cpp index d6ddfdb8..4579400d 100644 --- a/extern/imgui_patched/imgui_widgets.cpp +++ b/extern/imgui_patched/imgui_widgets.cpp @@ -3970,8 +3970,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0; const bool is_readonly = (flags & ImGuiInputTextFlags_ReadOnly) != 0; const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0; - // https://github.com/tildearrow/furnace/issues/624 - const bool is_undoable = 0; //(flags & ImGuiInputTextFlags_NoUndoRedo) == 0; + const bool is_undoable = (flags & ImGuiInputTextFlags_UndoRedo) != 0; const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0; if (is_resizable) IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag! diff --git a/src/gui/songInfo.cpp b/src/gui/songInfo.cpp index 5b113c64..8d4e0999 100644 --- a/src/gui/songInfo.cpp +++ b/src/gui/songInfo.cpp @@ -39,7 +39,7 @@ void FurnaceGUI::drawSongInfo() { ImGui::TableNextColumn(); float avail=ImGui::GetContentRegionAvail().x; ImGui::SetNextItemWidth(avail); - if (ImGui::InputText("##Name",&e->song.name)) { MARK_MODIFIED + if (ImGui::InputText("##Name",&e->song.name,ImGuiInputTextFlags_UndoRedo)) { MARK_MODIFIED updateWindowTitle(); } if (e->song.insLen==2) { @@ -61,7 +61,7 @@ void FurnaceGUI::drawSongInfo() { ImGui::Text("Author"); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(avail); - if (ImGui::InputText("##Author",&e->song.author)) { + if (ImGui::InputText("##Author",&e->song.author,ImGuiInputTextFlags_UndoRedo)) { MARK_MODIFIED; } @@ -70,7 +70,7 @@ void FurnaceGUI::drawSongInfo() { ImGui::Text("Album"); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(avail); - if (ImGui::InputText("##Category",&e->song.category)) { + if (ImGui::InputText("##Category",&e->song.category,ImGuiInputTextFlags_UndoRedo)) { MARK_MODIFIED; } ImGui::TableNextRow(); @@ -78,7 +78,7 @@ void FurnaceGUI::drawSongInfo() { ImGui::Text("System"); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(MAX(16.0f*dpiScale,avail-autoButtonSize-ImGui::GetStyle().ItemSpacing.x)); - if (ImGui::InputText("##SystemName",&e->song.systemName)) { + if (ImGui::InputText("##SystemName",&e->song.systemName,ImGuiInputTextFlags_UndoRedo)) { MARK_MODIFIED; updateWindowTitle(); e->song.autoSystem=false; diff --git a/src/gui/songNotes.cpp b/src/gui/songNotes.cpp index 74f4ed7f..338c7da2 100644 --- a/src/gui/songNotes.cpp +++ b/src/gui/songNotes.cpp @@ -30,7 +30,7 @@ void FurnaceGUI::drawNotes() { } if (!notesOpen) return; if (ImGui::Begin("Song Comments",¬esOpen,globalWinFlags)) { - ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail()); + ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo); } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_NOTES; ImGui::End(); diff --git a/src/gui/subSongs.cpp b/src/gui/subSongs.cpp index c56bf640..f076298f 100644 --- a/src/gui/subSongs.cpp +++ b/src/gui/subSongs.cpp @@ -91,7 +91,7 @@ void FurnaceGUI::drawSubSongs() { ImGui::Text("Name"); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ImGui::InputText("##SubSongName",&e->curSubSong->name)) { + if (ImGui::InputText("##SubSongName",&e->curSubSong->name,ImGuiInputTextFlags_UndoRedo)) { MARK_MODIFIED; } }