implement channel swapping

issue #378
This commit is contained in:
tildearrow 2022-04-28 03:36:15 -05:00
parent d211170e86
commit 859b2cf8db
5 changed files with 114 additions and 8 deletions

View file

@ -19,6 +19,8 @@
#include "gui.h"
#include "misc/cpp/imgui_stdlib.h"
#include "IconsFontAwesome4.h"
#include <imgui.h>
void FurnaceGUI::drawChannels() {
if (nextWindow==GUI_WINDOW_CHANNELS) {
@ -37,6 +39,18 @@ void FurnaceGUI::drawChannels() {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Checkbox("##Visible",&e->song.chanShow[i]);
ImGui::SameLine();
ImGui::BeginDisabled(i==0);
if (ImGui::Button(ICON_FA_CHEVRON_UP)) {
e->swapChannelsP(i,i-1);
}
ImGui::EndDisabled();
ImGui::SameLine();
ImGui::BeginDisabled(i==(e->getTotalChannelCount()-1));
if (ImGui::Button(ICON_FA_CHEVRON_DOWN)) {
e->swapChannelsP(i,i+1);
}
ImGui::EndDisabled();
ImGui::TableNextColumn();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
ImGui::InputTextWithHint("##ChanName",e->getChannelName(i),&e->song.chanName[i]);