GUI: add an option to exit mobile UI

This commit is contained in:
tildearrow 2022-09-09 19:23:53 -05:00
parent 0ac92209d0
commit f2e519d71e
3 changed files with 121 additions and 74 deletions

View File

@ -135,25 +135,44 @@ void FurnaceGUI::drawMobileControls() {
if (ImGui::Button("Sample",buttonSize)) {
mobScene=GUI_SCENE_SAMPLE;
}
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGui::Button("Song",buttonSize)) {
mobScene=GUI_SCENE_SONG;
}
ImGui::TableNextColumn();
if (ImGui::Button("Channels",buttonSize)) {
mobScene=GUI_SCENE_CHANNELS;
}
ImGui::TableNextColumn();
if (ImGui::Button("Chips",buttonSize)) {
mobScene=GUI_SCENE_CHIPS;
}
ImGui::TableNextColumn();
if (ImGui::Button("Other",buttonSize)) {
mobScene=GUI_SCENE_OTHER;
}
ImGui::EndTable();
}
ImGui::Separator();
if (settings.unifiedDataView) {
drawInsList(true);
} else {
switch (mobScene) {
case GUI_SCENE_PATTERN:
case GUI_SCENE_ORDERS:
case GUI_SCENE_INSTRUMENT:
drawInsList(true);
break;
case GUI_SCENE_WAVETABLE:
drawWaveList(true);
break;
case GUI_SCENE_SAMPLE:
drawSampleList(true);
break;
default:
drawInsList(true);
break;
}
}
case GUI_SCENE_SONG: {
if (ImGui::Button("New")) {
mobileMenuOpen=false;
//doAction(GUI_ACTION_NEW);
@ -188,21 +207,19 @@ void FurnaceGUI::drawMobileControls() {
ImGui::Button("Export VGM");
ImGui::Button("CmdStream");
ImGui::SameLine();
ImGui::Button("Panic");
ImGui::SameLine();
if (ImGui::Button("Settings")) {
mobileMenuOpen=false;
}
ImGui::SameLine();
if (ImGui::Button("About")) {
mobileMenuOpen=false;
mobileMenuPos=0.0f;
aboutOpen=true;
}
ImGui::Separator();
ImGui::Text("Song info here...");
break;
}
case GUI_SCENE_CHANNELS:
ImGui::Text("Channels here...");
break;
case GUI_SCENE_CHIPS:
ImGui::Text("Chips here...");
break;
case GUI_SCENE_OTHER: {
if (ImGui::Button("Osc")) {
oscOpen=!oscOpen;
}
@ -218,6 +235,27 @@ void FurnaceGUI::drawMobileControls() {
if (ImGui::Button("Stats")) {
statsOpen=!statsOpen;
}
ImGui::Separator();
ImGui::Button("Panic");
ImGui::SameLine();
if (ImGui::Button("Settings")) {
mobileMenuOpen=false;
}
ImGui::SameLine();
if (ImGui::Button("About")) {
mobileMenuOpen=false;
mobileMenuPos=0.0f;
aboutOpen=true;
}
if (ImGui::Button("Switch to Desktop Mode")) {
toggleMobileUI(!mobileUI);
}
break;
}
}
}
}
ImGui::End();
}

View File

@ -3245,6 +3245,11 @@ bool FurnaceGUI::loop() {
if (ImGui::MenuItem("reset layout")) {
showWarning("Are you sure you want to reset the workspace layout?",GUI_WARN_RESET_LAYOUT);
}
#ifdef IS_MOBILE
if (ImGui::MenuItem("switch to mobile view")) {
toggleMobileUI(!mobileUI);
}
#endif
if (ImGui::MenuItem("settings...",BIND_FOR(GUI_ACTION_WINDOW_SETTINGS))) {
syncSettings();
settingsOpen=true;
@ -3372,12 +3377,6 @@ bool FurnaceGUI::loop() {
pianoOpen=true;
drawMobileControls();
switch (mobScene) {
case GUI_SCENE_PATTERN:
patternOpen=true;
curWindow=GUI_WINDOW_PATTERN;
drawPattern();
drawPiano();
break;
case GUI_SCENE_ORDERS:
ordersOpen=true;
curWindow=GUI_WINDOW_ORDERS;
@ -3401,6 +3400,12 @@ bool FurnaceGUI::loop() {
drawSampleEdit();
drawPiano();
break;
default:
patternOpen=true;
curWindow=GUI_WINDOW_PATTERN;
drawPattern();
drawPiano();
break;
}
} else {
globalWinFlags=0;

View File

@ -265,7 +265,11 @@ enum FurnaceGUIMobileScenes {
GUI_SCENE_ORDERS,
GUI_SCENE_INSTRUMENT,
GUI_SCENE_WAVETABLE,
GUI_SCENE_SAMPLE
GUI_SCENE_SAMPLE,
GUI_SCENE_SONG,
GUI_SCENE_CHANNELS,
GUI_SCENE_CHIPS,
GUI_SCENE_OTHER,
};
enum FurnaceGUIFileDialogs {