mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-24 05:25:12 +00:00
GUI: slight changes to edit controls
- align classic - stretch compact vertical
This commit is contained in:
parent
6a3ce215ad
commit
08d85869a9
1 changed files with 39 additions and 24 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "gui.h"
|
||||
#include "IconsFontAwesome4.h"
|
||||
#include <imgui.h>
|
||||
|
||||
void FurnaceGUI::drawMobileControls() {
|
||||
if (ImGui::Begin("Mobile Controls",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) {
|
||||
|
@ -81,8 +82,15 @@ void FurnaceGUI::drawEditControls() {
|
|||
switch (settings.controlLayout) {
|
||||
case 0: // classic
|
||||
if (ImGui::Begin("Play/Edit Controls",&editControlsOpen,globalWinFlags)) {
|
||||
if (ImGui::BeginTable("PlayEditAlign",2)) {
|
||||
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed);
|
||||
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch);
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Octave");
|
||||
ImGui::SameLine();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
||||
if (curOctave>7) curOctave=7;
|
||||
if (curOctave<-5) curOctave=-5;
|
||||
|
@ -93,8 +101,11 @@ void FurnaceGUI::drawEditControls() {
|
|||
}
|
||||
}
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Edit Step");
|
||||
ImGui::SameLine();
|
||||
ImGui::TableNextColumn();
|
||||
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;
|
||||
|
@ -104,6 +115,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
}
|
||||
}
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(e->isPlaying()));
|
||||
if (ImGui::Button(ICON_FA_PLAY "##Play")) {
|
||||
play();
|
||||
|
@ -219,35 +233,36 @@ void FurnaceGUI::drawEditControls() {
|
|||
break;
|
||||
case 2: // compact vertical
|
||||
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()));
|
||||
if (ImGui::Button(ICON_FA_PLAY "##Play")) {
|
||||
if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) {
|
||||
play();
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
if (ImGui::Button(ICON_FA_STOP "##Stop")) {
|
||||
if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) {
|
||||
stop();
|
||||
}
|
||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) {
|
||||
e->stepOne(cursor.y);
|
||||
pendingStepUpdate=true;
|
||||
}
|
||||
|
||||
bool repeatPattern=e->getRepeatPattern();
|
||||
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);
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(edit));
|
||||
if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) {
|
||||
if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) {
|
||||
edit=!edit;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
bool metro=e->getMetronome();
|
||||
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);
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
|
@ -278,12 +293,12 @@ void FurnaceGUI::drawEditControls() {
|
|||
|
||||
ImGui::Text("Foll.");
|
||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(followOrders));
|
||||
if (ImGui::SmallButton("Ord##FollowOrders")) { handleUnimportant
|
||||
if (ImGui::Button("Ord##FollowOrders",buttonSize)) { handleUnimportant
|
||||
followOrders=!followOrders;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PushStyleColor(ImGuiCol_Button,TOGGLE_COLOR(followPattern));
|
||||
if (ImGui::SmallButton("Pat##FollowPattern")) { handleUnimportant
|
||||
if (ImGui::Button("Pat##FollowPattern",buttonSize)) { handleUnimportant
|
||||
followPattern=!followPattern;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
|
|
Loading…
Reference in a new issue