From 7c509ba9b89c91354526a0bedaf4da2e923eeb24 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 19 Jan 2022 18:10:42 -0500 Subject: [PATCH] highlight cursor row when edit mode is on closes #29 --- src/gui/gui.cpp | 5 ++++- src/gui/gui.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 8c0c49de4..78a3e29da 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1523,7 +1523,9 @@ void FurnaceGUI::drawPattern() { continue; } ImGui::TableNextColumn(); - if (e->isPlaying() && oldRow==i) { + if (edit && cursor.y==i) { + ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_EDITING])); + } else if (e->isPlaying() && oldRow==i) { ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,0x40ffffff); } else if (e->song.hilightB>0 && !(i%e->song.hilightB)) { ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_HI_2])); @@ -3832,6 +3834,7 @@ FurnaceGUI::FurnaceGUI(): oldOrdersLen(0) { uiColors[GUI_COLOR_BACKGROUND]=ImVec4(0.1f,0.1f,0.1f,1.0f); uiColors[GUI_COLOR_FRAME_BACKGROUND]=ImVec4(0.0f,0.0f,0.0f,0.85f); + uiColors[GUI_COLOR_EDITING]=ImVec4(0.2f,0.1f,0.1f,1.0f); uiColors[GUI_COLOR_INSTR_FM]=ImVec4(0.6f,0.9f,1.0f,1.0f); uiColors[GUI_COLOR_INSTR_STD]=ImVec4(0.6f,1.0f,0.5f,1.0f); uiColors[GUI_COLOR_INSTR_GB]=ImVec4(1.0f,1.0f,0.5f,1.0f); diff --git a/src/gui/gui.h b/src/gui/gui.h index a1dedeef9..34116e3db 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -13,6 +13,7 @@ enum FurnaceGUIColors { GUI_COLOR_HEADER, GUI_COLOR_ITEM_BACKGROUND, GUI_COLOR_ITEM_FOREGROUND, + GUI_COLOR_EDITING, GUI_COLOR_INSTR_FM, GUI_COLOR_INSTR_STD, GUI_COLOR_INSTR_GB,