GUI: there we go

now the buttons won't scroll in lists
This commit is contained in:
tildearrow 2022-02-04 00:11:16 -05:00
parent f03b410281
commit 507f3d7de1

View file

@ -1911,22 +1911,27 @@ void FurnaceGUI::drawWaveList() {
} }
} }
ImGui::Separator(); ImGui::Separator();
for (int i=0; i<(int)e->song.wave.size(); i++) { if (ImGui::BeginTable("WaveListScroll",1,ImGuiTableFlags_ScrollY)) {
DivWavetable* wave=e->song.wave[i]; for (int i=0; i<(int)e->song.wave.size(); i++) {
for (int i=0; i<wave->len; i++) { DivWavetable* wave=e->song.wave[i];
wavePreview[i]=wave->data[i]; for (int i=0; i<wave->len; i++) {
} wavePreview[i]=wave->data[i];
if (wave->len>0) wavePreview[wave->len]=wave->data[wave->len-1];
if (ImGui::Selectable(fmt::sprintf("%d##_WAVE%d\n",i,i).c_str(),curWave==i)) {
curWave=i;
}
if (ImGui::IsItemHovered()) {
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
waveEditOpen=true;
} }
if (wave->len>0) wavePreview[wave->len]=wave->data[wave->len-1];
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGui::Selectable(fmt::sprintf("%d##_WAVE%d\n",i,i).c_str(),curWave==i)) {
curWave=i;
}
if (ImGui::IsItemHovered()) {
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
waveEditOpen=true;
}
}
ImGui::SameLine();
PlotNoLerp(fmt::sprintf("##_WAVEP%d",i).c_str(),wavePreview,wave->len+1,0,NULL,0,wave->max);
} }
ImGui::SameLine(); ImGui::EndTable();
PlotNoLerp(fmt::sprintf("##_WAVEP%d",i).c_str(),wavePreview,wave->len+1,0,NULL,0,wave->max);
} }
} }
if (ImGui::IsWindowFocused()) curWindow=GUI_WINDOW_WAVE_LIST; if (ImGui::IsWindowFocused()) curWindow=GUI_WINDOW_WAVE_LIST;
@ -2046,21 +2051,26 @@ void FurnaceGUI::drawSampleList() {
e->stopSamplePreview(); e->stopSamplePreview();
} }
ImGui::Separator(); ImGui::Separator();
for (int i=0; i<(int)e->song.sample.size(); i++) { if (ImGui::BeginTable("SampleListScroll",1,ImGuiTableFlags_ScrollY)) {
DivSample* sample=e->song.sample[i]; for (int i=0; i<(int)e->song.sample.size(); i++) {
if ((i%12)==0) { DivSample* sample=e->song.sample[i];
if (i>0) ImGui::Unindent(); ImGui::TableNextRow();
ImGui::Text("Bank %d",i/12); ImGui::TableNextColumn();
ImGui::Indent(); if ((i%12)==0) {
} if (i>0) ImGui::Unindent();
if (ImGui::Selectable(fmt::sprintf("%s: %s##_SAM%d",sampleNote[i%12],sample->name,i).c_str(),curSample==i)) { ImGui::Text("Bank %d",i/12);
curSample=i; ImGui::Indent();
} }
if (ImGui::IsItemHovered()) { if (ImGui::Selectable(fmt::sprintf("%s: %s##_SAM%d",sampleNote[i%12],sample->name,i).c_str(),curSample==i)) {
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { curSample=i;
sampleEditOpen=true; }
if (ImGui::IsItemHovered()) {
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
sampleEditOpen=true;
}
} }
} }
ImGui::EndTable();
} }
ImGui::Unindent(); ImGui::Unindent();
} }