GUI: slight changes to edit controls
- align classic - stretch compact vertical
This commit is contained in:
parent
6a3ce215ad
commit
08d85869a9
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "IconsFontAwesome4.h"
|
#include "IconsFontAwesome4.h"
|
||||||
|
#include <imgui.h>
|
||||||
|
|
||||||
void FurnaceGUI::drawMobileControls() {
|
void FurnaceGUI::drawMobileControls() {
|
||||||
if (ImGui::Begin("Mobile Controls",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) {
|
if (ImGui::Begin("Mobile Controls",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) {
|
||||||
|
|
@ -81,27 +82,40 @@ void FurnaceGUI::drawEditControls() {
|
||||||
switch (settings.controlLayout) {
|
switch (settings.controlLayout) {
|
||||||
case 0: // classic
|
case 0: // classic
|
||||||
if (ImGui::Begin("Play/Edit Controls",&editControlsOpen,globalWinFlags)) {
|
if (ImGui::Begin("Play/Edit Controls",&editControlsOpen,globalWinFlags)) {
|
||||||
ImGui::Text("Octave");
|
if (ImGui::BeginTable("PlayEditAlign",2)) {
|
||||||
ImGui::SameLine();
|
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed);
|
||||||
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch);
|
||||||
if (curOctave>7) curOctave=7;
|
|
||||||
if (curOctave<-5) curOctave=-5;
|
|
||||||
e->autoNoteOffAll();
|
|
||||||
|
|
||||||
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
ImGui::TableNextRow();
|
||||||
nextWindow=GUI_WINDOW_PATTERN;
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("Octave");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
|
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
||||||
|
if (curOctave>7) curOctave=7;
|
||||||
|
if (curOctave<-5) curOctave=-5;
|
||||||
|
e->autoNoteOffAll();
|
||||||
|
|
||||||
|
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
||||||
|
nextWindow=GUI_WINDOW_PATTERN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::Text("Edit Step");
|
ImGui::TableNextRow();
|
||||||
ImGui::SameLine();
|
ImGui::TableNextColumn();
|
||||||
if (ImGui::InputInt("##EditStep",&editStep,1,1)) {
|
ImGui::Text("Edit Step");
|
||||||
if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1;
|
ImGui::TableNextColumn();
|
||||||
if (editStep<0) editStep=0;
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
|
if (ImGui::InputInt("##EditStep",&editStep,1,1)) {
|
||||||
|
if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1;
|
||||||
|
if (editStep<0) editStep=0;
|
||||||
|
|
||||||
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
||||||
nextWindow=GUI_WINDOW_PATTERN;
|
nextWindow=GUI_WINDOW_PATTERN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying()));
|
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying()));
|
||||||
|
|
@ -219,35 +233,36 @@ void FurnaceGUI::drawEditControls() {
|
||||||
break;
|
break;
|
||||||
case 2: // compact vertical
|
case 2: // compact vertical
|
||||||
if (ImGui::Begin("Play/Edit Controls",&editControlsOpen,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) {
|
if (ImGui::Begin("Play/Edit Controls",&editControlsOpen,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) {
|
||||||
|
ImVec2 buttonSize=ImVec2(ImGui::GetContentRegionAvail().x,0.0f);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying()));
|
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying()));
|
||||||
if (ImGui::Button(ICON_FA_PLAY "##Play")) {
|
if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) {
|
||||||
play();
|
play();
|
||||||
}
|
}
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
if (ImGui::Button(ICON_FA_STOP "##Stop")) {
|
if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) {
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) {
|
||||||
e->stepOne(cursor.y);
|
e->stepOne(cursor.y);
|
||||||
pendingStepUpdate=true;
|
pendingStepUpdate=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool repeatPattern=e->getRepeatPattern();
|
bool repeatPattern=e->getRepeatPattern();
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(repeatPattern));
|
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(repeatPattern));
|
||||||
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) {
|
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) {
|
||||||
e->setRepeatPattern(!repeatPattern);
|
e->setRepeatPattern(!repeatPattern);
|
||||||
}
|
}
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(edit));
|
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(edit));
|
||||||
if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) {
|
if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) {
|
||||||
edit=!edit;
|
edit=!edit;
|
||||||
}
|
}
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
|
||||||
bool metro=e->getMetronome();
|
bool metro=e->getMetronome();
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(metro));
|
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(metro));
|
||||||
if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) {
|
if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) {
|
||||||
e->setMetronome(!metro);
|
e->setMetronome(!metro);
|
||||||
}
|
}
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
|
@ -278,12 +293,12 @@ void FurnaceGUI::drawEditControls() {
|
||||||
|
|
||||||
ImGui::Text("Foll.");
|
ImGui::Text("Foll.");
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(followOrders));
|
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(followOrders));
|
||||||
if (ImGui::SmallButton("Ord##FollowOrders")) { handleUnimportant
|
if (ImGui::Button("Ord##FollowOrders",buttonSize)) { handleUnimportant
|
||||||
followOrders=!followOrders;
|
followOrders=!followOrders;
|
||||||
}
|
}
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(followPattern));
|
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(followPattern));
|
||||||
if (ImGui::SmallButton("Pat##FollowPattern")) { handleUnimportant
|
if (ImGui::Button("Pat##FollowPattern",buttonSize)) { handleUnimportant
|
||||||
followPattern=!followPattern;
|
followPattern=!followPattern;
|
||||||
}
|
}
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue