Skip to content

Commit

Permalink
Merge branch 'tildearrow:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
architectnt authored Dec 6, 2024
2 parents 0b90ba1 + 4b1f993 commit 75ec829
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/gui/effectList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ void FurnaceGUI::drawEffectList() {
ImGui::EndPopup();
}

if (ImGui::BeginTable("effectList",2)) {
if (ImGui::BeginTable("effectList",2,ImGuiTableFlags_ScrollY)) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch);

Expand Down
4 changes: 2 additions & 2 deletions src/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2809,8 +2809,8 @@ void FurnaceGUI::processDrags(int dragX, int dragY) {
}
}
if (sampleDragActive) {
int x=samplePos+round(double(dragX-sampleDragStart.x)*sampleZoom);
int x1=samplePos+round(double(dragX-sampleDragStart.x+1)*sampleZoom);
int x=samplePos+floor(double(dragX-sampleDragStart.x)*sampleZoom);
int x1=samplePos+floor(double(dragX-sampleDragStart.x+1)*sampleZoom);
if (x<0) x=0;
if (sampleDragMode) {
if (x>=(int)sampleDragLen) x=sampleDragLen-1;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2001,6 +2001,7 @@ class FurnaceGUI {
float vibrationStrength;
int vibrationLength;
int s3mOPL3;
int songNotesWrap;
String mainFontPath;
String headFontPath;
String patFontPath;
Expand Down Expand Up @@ -2261,6 +2262,7 @@ class FurnaceGUI {
vibrationStrength(0.5f),
vibrationLength(20),
s3mOPL3(1),
songNotesWrap(0),
mainFontPath(""),
headFontPath(""),
patFontPath(""),
Expand Down
2 changes: 1 addition & 1 deletion src/gui/orders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void FurnaceGUI::drawOrders() {
bool tooSmall=((displayChans+1)>((ImGui::GetContentRegionAvail().x)/(ImGui::CalcTextSize("AA").x+2.0*ImGui::GetStyle().ItemInnerSpacing.x)));
float yHeight=ImGui::GetContentRegionAvail().y;
float lineHeight=(ImGui::GetTextLineHeight()+4*dpiScale);
if (e->isPlaying()) {
if (e->isPlaying() || haveHitBounds) {
if (followOrders) {
float nextOrdScroll=(playOrder+1)*lineHeight-((yHeight-(tooSmall?ImGui::GetStyle().ScrollbarSize:0.0f))/2.0f);
if (nextOrdScroll<0.0f) nextOrdScroll=0.0f;
Expand Down
15 changes: 14 additions & 1 deletion src/gui/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3840,6 +3840,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;
Expand Down Expand Up @@ -4602,7 +4610,7 @@ void FurnaceGUI::drawSettings() {
FurnaceGUIBackupEntry& thisEntry=backupEntries[i];

if (thisEntry.name==prevEntry.name) {
thisEntry.size+=prevEntry.size;
prevEntry.size+=thisEntry.size;
backupEntries.erase(backupEntries.begin()+i);
i--;
}
Expand Down Expand Up @@ -5004,6 +5012,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);
Expand Down Expand Up @@ -5363,6 +5373,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);
Expand Down Expand Up @@ -5598,6 +5609,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);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/songNotes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",&notesOpen,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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/subSongs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/gui/sysPicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ DivSystem FurnaceGUI::systemPicker(bool fullWidth) {
}
}
}
if (ImGui::BeginTable("SysList",1,ImGuiTableFlags_ScrollY,ImVec2(fullWidth ? ImGui::GetContentRegionAvail().x : 500.0f*dpiScale,200.0f*dpiScale))) {
if (ImGui::BeginTable("SysList",1,ImGuiTableFlags_ScrollY|ImGuiTableFlags_BordersOuterH,ImVec2(fullWidth ? ImGui::GetContentRegionAvail().x : 500.0f*dpiScale,200.0f*dpiScale))) {
if (sysSearchQuery.empty()) {
// display chip list
for (int j=0; curSysSection[j]; j++) {
Expand All @@ -87,7 +87,6 @@ DivSystem FurnaceGUI::systemPicker(bool fullWidth) {
}
ImGui::EndTable();
}
ImGui::Separator();
if (ImGui::BeginChild("SysDesc",ImVec2(0.0f,150.0f*dpiScale),false,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse)) {
if (hoveredSys!=DIV_SYSTEM_NULL) {
const DivSysDef* sysDef=e->getSystemDef(hoveredSys);
Expand Down

0 comments on commit 75ec829

Please sign in to comment.