GUI: even more mobile work

This commit is contained in:
tildearrow 2022-09-09 18:53:20 -05:00
parent d021005f26
commit 0ac92209d0
11 changed files with 353 additions and 277 deletions

View file

@ -29,14 +29,20 @@ const char* sampleNote[12]={
"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"
};
void FurnaceGUI::drawInsList() {
void FurnaceGUI::drawInsList(bool asChild) {
if (nextWindow==GUI_WINDOW_INS_LIST) {
insListOpen=true;
ImGui::SetNextWindowFocus();
nextWindow=GUI_WINDOW_NOTHING;
}
if (!insListOpen) return;
if (ImGui::Begin("Instruments",&insListOpen,globalWinFlags)) {
if (!insListOpen && !asChild) return;
bool began=false;
if (asChild) {
began=ImGui::BeginChild("Instruments");
} else {
began=ImGui::Begin("Instruments",&insListOpen,globalWinFlags);
}
if (began) {
if (settings.unifiedDataView) settings.horizontalDataView=0;
if (ImGui::Button(ICON_FA_PLUS "##InsAdd")) {
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_ADD);
@ -409,11 +415,15 @@ void FurnaceGUI::drawInsList() {
ImGui::EndTable();
}
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_INS_LIST;
ImGui::End();
if (asChild) {
ImGui::EndChild();
} else {
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_INS_LIST;
ImGui::End();
}
}
void FurnaceGUI::drawWaveList() {
void FurnaceGUI::drawWaveList(bool asChild) {
if (nextWindow==GUI_WINDOW_WAVE_LIST) {
waveListOpen=true;
if (settings.unifiedDataView) {
@ -424,8 +434,14 @@ void FurnaceGUI::drawWaveList() {
nextWindow=GUI_WINDOW_NOTHING;
}
if (settings.unifiedDataView) return;
if (!waveListOpen) return;
if (ImGui::Begin("Wavetables",&waveListOpen,globalWinFlags)) {
if (!waveListOpen && !asChild) return;
bool began=false;
if (asChild) {
began=ImGui::BeginChild("Wavetables");
} else {
began=ImGui::Begin("Wavetables",&waveListOpen,globalWinFlags);
}
if (began) {
if (ImGui::Button(ICON_FA_PLUS "##WaveAdd")) {
doAction(GUI_ACTION_WAVE_LIST_ADD);
}
@ -476,11 +492,15 @@ void FurnaceGUI::drawWaveList() {
ImGui::EndTable();
}
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_WAVE_LIST;
ImGui::End();
if (asChild) {
ImGui::EndChild();
} else {
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_WAVE_LIST;
ImGui::End();
}
}
void FurnaceGUI::drawSampleList() {
void FurnaceGUI::drawSampleList(bool asChild) {
if (nextWindow==GUI_WINDOW_SAMPLE_LIST) {
sampleListOpen=true;
if (settings.unifiedDataView) {
@ -491,8 +511,14 @@ void FurnaceGUI::drawSampleList() {
nextWindow=GUI_WINDOW_NOTHING;
}
if (settings.unifiedDataView) return;
if (!sampleListOpen) return;
if (ImGui::Begin("Samples",&sampleListOpen,globalWinFlags)) {
if (!sampleListOpen && !asChild) return;
bool began=false;
if (asChild) {
began=ImGui::BeginChild("Samples");
} else {
began=ImGui::Begin("Samples",&sampleListOpen,globalWinFlags);
}
if (began) {
if (ImGui::Button(ICON_FA_FILE "##SampleAdd")) {
doAction(GUI_ACTION_SAMPLE_LIST_ADD);
}
@ -548,8 +574,12 @@ void FurnaceGUI::drawSampleList() {
}
ImGui::Unindent();
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_SAMPLE_LIST;
ImGui::End();
if (asChild) {
ImGui::EndChild();
} else {
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_SAMPLE_LIST;
ImGui::End();
}
}
void FurnaceGUI::actualWaveList() {