GUI: different pattern manager layout

This commit is contained in:
tildearrow 2022-08-25 18:13:46 -05:00
parent 0b7592e031
commit a7d0949eac

View file

@ -47,7 +47,11 @@ void FurnaceGUI::drawPatManager() {
}); });
} }
if (ImGui::BeginTable("PatManTable",257,ImGuiTableFlags_ScrollX|ImGuiTableFlags_SizingFixedFit)) {
ImGui::PushFont(patFont);
for (int i=0; i<e->getTotalChannelCount(); i++) { for (int i=0; i<e->getTotalChannelCount(); i++) {
ImGui::TableNextRow();
memset(isUsed,0,256); memset(isUsed,0,256);
memset(isNull,0,256*sizeof(bool)); memset(isNull,0,256*sizeof(bool));
for (int j=0; j<e->curSubSong->ordersLen; j++) { for (int j=0; j<e->curSubSong->ordersLen; j++) {
@ -56,12 +60,11 @@ void FurnaceGUI::drawPatManager() {
for (int j=0; j<256; j++) { for (int j=0; j<256; j++) {
isNull[j]=(e->curSubSong->pat[i].data[j]==NULL); isNull[j]=(e->curSubSong->pat[i].data[j]==NULL);
} }
ImGui::Text("%d. %s",i+1,e->getChannelName(i)); ImGui::TableNextColumn();
ImGui::Text("%s",e->getChannelShortName(i));
ImGui::PushID(1000+i); ImGui::PushID(1000+i);
ImGui::PushFont(patFont);
if (ImGui::BeginTable("PatManTable",32)) {
for (int k=0; k<256; k++) { for (int k=0; k<256; k++) {
if ((k&31)==0) ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
snprintf(id,1023,"%.2X",k); snprintf(id,1023,"%.2X",k);
@ -98,10 +101,11 @@ void FurnaceGUI::drawPatManager() {
} }
ImGui::PopStyleColor(); ImGui::PopStyleColor();
} }
ImGui::EndTable(); ImGui::PopID();
} }
ImGui::PopFont(); ImGui::PopFont();
ImGui::PopID();
ImGui::EndTable();
} }
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_PAT_MANAGER; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_PAT_MANAGER;