GUI: highlight cur display & play order separately

issue #932
This commit is contained in:
tildearrow 2023-02-05 18:50:17 -05:00
parent 26739bba11
commit 56d4950fad
4 changed files with 15 additions and 1 deletions

View file

@ -113,6 +113,7 @@ enum FurnaceGUIColors {
GUI_COLOR_ORDER_ROW_INDEX, GUI_COLOR_ORDER_ROW_INDEX,
GUI_COLOR_ORDER_ACTIVE, GUI_COLOR_ORDER_ACTIVE,
GUI_COLOR_ORDER_SELECTED,
GUI_COLOR_ORDER_SIMILAR, GUI_COLOR_ORDER_SIMILAR,
GUI_COLOR_ORDER_INACTIVE, GUI_COLOR_ORDER_INACTIVE,

View file

@ -742,6 +742,7 @@ const FurnaceGUIColorDef guiColors[GUI_COLOR_MAX]={
D(GUI_COLOR_ORDER_ROW_INDEX,"",ImVec4(0.5f,0.8f,1.0f,1.0f)), D(GUI_COLOR_ORDER_ROW_INDEX,"",ImVec4(0.5f,0.8f,1.0f,1.0f)),
D(GUI_COLOR_ORDER_ACTIVE,"",ImVec4(0.4f,0.7f,1.0f,0.25f)), D(GUI_COLOR_ORDER_ACTIVE,"",ImVec4(0.4f,0.7f,1.0f,0.25f)),
D(GUI_COLOR_ORDER_SELECTED,"",ImVec4(0.6f,0.8f,1.0f,0.75f)),
D(GUI_COLOR_ORDER_SIMILAR,"",ImVec4(0.5f,1.0f,1.0f,1.0f)), D(GUI_COLOR_ORDER_SIMILAR,"",ImVec4(0.5f,1.0f,1.0f,1.0f)),
D(GUI_COLOR_ORDER_INACTIVE,"",ImVec4(1.0f,1.0f,1.0f,1.0f)), D(GUI_COLOR_ORDER_INACTIVE,"",ImVec4(1.0f,1.0f,1.0f,1.0f)),

View file

@ -19,8 +19,10 @@
#include "gui.h" #include "gui.h"
#include <fmt/printf.h> #include <fmt/printf.h>
#include <imgui.h>
#include "IconsFontAwesome4.h" #include "IconsFontAwesome4.h"
#include "imgui_internal.h" #include "imgui_internal.h"
#include "../ta-log.h"
void FurnaceGUI::drawMobileOrderSel() { void FurnaceGUI::drawMobileOrderSel() {
if (!portrait) return; if (!portrait) return;
@ -129,6 +131,7 @@ void FurnaceGUI::drawOrders() {
} }
} }
ImGui::TableNextRow(0,lineHeight); ImGui::TableNextRow(0,lineHeight);
ImVec2 ra=ImGui::GetContentRegionAvail();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_ORDER_ROW_INDEX]); ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_ORDER_ROW_INDEX]);
for (int i=0; i<e->getTotalChannelCount(); i++) { for (int i=0; i<e->getTotalChannelCount(); i++) {
@ -141,6 +144,14 @@ void FurnaceGUI::drawOrders() {
ImGui::TableNextRow(0,lineHeight); ImGui::TableNextRow(0,lineHeight);
if (oldOrder1==i) ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_ORDER_ACTIVE])); if (oldOrder1==i) ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_ORDER_ACTIVE]));
ImGui::TableNextColumn(); ImGui::TableNextColumn();
if ((!followPattern && curOrder==i) || (followPattern && oldOrder1==i)) {
// draw a border
ImDrawList* dl=ImGui::GetWindowDrawList();
ImVec2 rBegin=ImGui::GetCursorScreenPos();
rBegin.y-=ImGui::GetStyle().CellPadding.y;
ImVec2 rEnd=ImVec2(rBegin.x+ra.x,rBegin.y+lineHeight);
dl->AddRect(rBegin,rEnd,ImGui::GetColorU32(uiColors[GUI_COLOR_ORDER_SELECTED]),2.0f*dpiScale);
}
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_ORDER_ROW_INDEX]); ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_ORDER_ROW_INDEX]);
bool highlightLoop=(i>=loopOrder && i<=loopEnd); bool highlightLoop=(i>=loopOrder && i<=loopEnd);
if (highlightLoop) ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg,ImGui::GetColorU32(uiColors[GUI_COLOR_SONG_LOOP])); if (highlightLoop) ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg,ImGui::GetColorU32(uiColors[GUI_COLOR_SONG_LOOP]));

View file

@ -1811,7 +1811,8 @@ void FurnaceGUI::drawSettings() {
} }
if (ImGui::TreeNode("Orders")) { if (ImGui::TreeNode("Orders")) {
UI_COLOR_CONFIG(GUI_COLOR_ORDER_ROW_INDEX,"Order number"); UI_COLOR_CONFIG(GUI_COLOR_ORDER_ROW_INDEX,"Order number");
UI_COLOR_CONFIG(GUI_COLOR_ORDER_ACTIVE,"Current order background"); UI_COLOR_CONFIG(GUI_COLOR_ORDER_ACTIVE,"Playing order background");
UI_COLOR_CONFIG(GUI_COLOR_ORDER_SELECTED,"Selected order");
UI_COLOR_CONFIG(GUI_COLOR_ORDER_SIMILAR,"Similar patterns"); UI_COLOR_CONFIG(GUI_COLOR_ORDER_SIMILAR,"Similar patterns");
UI_COLOR_CONFIG(GUI_COLOR_ORDER_INACTIVE,"Inactive patterns"); UI_COLOR_CONFIG(GUI_COLOR_ORDER_INACTIVE,"Inactive patterns");
ImGui::TreePop(); ImGui::TreePop();