diff --git a/src/gui/gui.h b/src/gui/gui.h index 00c7d8d09..e3f7dee22 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2000,6 +2000,7 @@ class FurnaceGUI { float vibrationStrength; int vibrationLength; int s3mOPL3; + int songNotesWrap; String mainFontPath; String headFontPath; String patFontPath; @@ -2260,6 +2261,7 @@ class FurnaceGUI { vibrationStrength(0.5f), vibrationLength(20), s3mOPL3(1), + songNotesWrap(0), mainFontPath(""), headFontPath(""), patFontPath(""), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 990d69c01..e930c04d7 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -33,6 +33,7 @@ #include "misc/freetype/imgui_freetype.h" #include "scaling.h" #include +#include #ifdef _WIN32 #include @@ -3840,6 +3841,14 @@ void FurnaceGUI::drawSettings() { settingsChanged=true; } rightClickable + // SUBSECTION SONG COMMENTS + CONFIG_SUBSECTION(_("Song Comments")); + bool songNotesWrapB=settings.songNotesWrap; + if (ImGui::Checkbox(_("Wrap text"), &songNotesWrapB)) { + settings.songNotesWrap=songNotesWrapB; + settingsChanged=true; + } + // SUBSECTION WINDOWS CONFIG_SUBSECTION(_("Windows")); bool roundedWindowsB=settings.roundedWindows; @@ -5004,6 +5013,8 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { settings.oscAntiAlias=conf.getInt("oscAntiAlias",1); settings.oscLineSize=conf.getFloat("oscLineSize",1.0f); + settings.songNotesWrap=conf.getInt("songNotesWrap", 0); + settings.channelColors=conf.getInt("channelColors",1); settings.channelTextColors=conf.getInt("channelTextColors",0); settings.channelStyle=conf.getInt("channelStyle",1); @@ -5363,6 +5374,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { clampSetting(settings.playbackTime,0,1); clampSetting(settings.shaderOsc,0,1); clampSetting(settings.oscLineSize,0.25f,16.0f); + clampSetting(settings.songNotesWrap, 0, 1); clampSetting(settings.cursorWheelStep,0,1); clampSetting(settings.vsync,0,4); clampSetting(settings.frameRateLimit,0,1000); @@ -5598,6 +5610,8 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { conf.set("oscAntiAlias",settings.oscAntiAlias); conf.set("oscLineSize",settings.oscLineSize); + conf.set("songNotesWrap",settings.songNotesWrap); + conf.set("channelColors",settings.channelColors); conf.set("channelTextColors",settings.channelTextColors); conf.set("channelStyle",settings.channelStyle); diff --git a/src/gui/songNotes.cpp b/src/gui/songNotes.cpp index 15ecb2a82..e4133452d 100644 --- a/src/gui/songNotes.cpp +++ b/src/gui/songNotes.cpp @@ -31,7 +31,7 @@ void FurnaceGUI::drawNotes(bool asChild) { if (!notesOpen && !asChild) return; bool began=asChild?ImGui::BeginChild("Song Info##Song Information"):ImGui::Begin("Song Comments",¬esOpen,globalWinFlags,_("Song Comments")); if (began) { - if (ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo)) { + if (ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo|(settings.songNotesWrap?ImGuiInputTextFlags_WordWrapping:0))) { MARK_MODIFIED; } } diff --git a/src/gui/subSongs.cpp b/src/gui/subSongs.cpp index f67a85089..f41a3ae9e 100644 --- a/src/gui/subSongs.cpp +++ b/src/gui/subSongs.cpp @@ -133,7 +133,7 @@ void FurnaceGUI::drawSubSongs(bool asChild) { } if (ImGui::GetContentRegionAvail().y>(10.0f*dpiScale)) { - if (ImGui::InputTextMultiline("##SubSongNotes",&e->curSubSong->notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo)) { + if (ImGui::InputTextMultiline("##SubSongNotes",&e->curSubSong->notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo|(settings.songNotesWrap?ImGuiInputTextFlags_WordWrapping:0))) { MARK_MODIFIED; } }