Skip to content

Commit cc86eb7

Browse files
committed
Update layout of SGU-1 wave visualizer
1 parent 3961680 commit cc86eb7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/ui/ui_sgu1.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static void _ui_sgu1_draw_state(ui_sgu1_t* win) {
112112
if (ImGui::CollapsingHeader("Channels Output", ImGuiTreeNodeFlags_DefaultOpen)) {
113113
ImVec4 on_ch_col = ImGui::GetStyleColorVec4(ImGuiCol_Text);
114114
ImVec4 off_ch_col = ImGui::GetStyleColorVec4(ImGuiCol_TextDisabled);
115-
if (ImGui::BeginTable("##sgu_waves", 2)) {
115+
if (ImGui::BeginTable("##sgu_waves", 3)) {
116116
char buf[32];
117117
for (int i = 0; i < SGU_CHNS; i++) {
118118
ImGui::TableNextColumn();
@@ -258,11 +258,7 @@ static void _ui_sgu1_draw_state(ui_sgu1_t* win) {
258258
}
259259
ImGui::TableSetBgColor(
260260
ImGuiTableBgTarget_CellBg,
261-
ImGui::ColorConvertFloat4ToU32(ImVec4(
262-
vus[ch],
263-
vus[ch],
264-
vus[ch],
265-
vus[ch] * 2.0f / 3.0f))); // Semi-transparent red
261+
ImGui::ColorConvertFloat4ToU32(ImVec4(vus[ch], vus[ch], vus[ch], vus[ch] * 2.0f / 3.0f)));
266262
ImGui::TableNextColumn();
267263
}
268264
}
@@ -372,7 +368,12 @@ static void _ui_sgu1_draw_state(ui_sgu1_t* win) {
372368
}
373369
else {
374370
ImGui::TableNextColumn();
371+
const ImVec4 off_ch_col = ImGui::GetStyleColorVec4(ImGuiCol_TableRowBg);
372+
const ImVec4 on_ch_col = ImGui::GetStyleColorVec4(ImGuiCol_TitleBgActive);
375373
for (int i = 0; i < SGU_CHNS; i++) {
374+
ImGui::TableSetBgColor(
375+
ImGuiTableBgTarget_CellBg,
376+
ImGui::ColorConvertFloat4ToU32(su->chan[i].flags0 & SGU1_FLAGS0_CTL_GATE ? on_ch_col : off_ch_col));
376377
ui_util_b8("", su->chan[i].flags0);
377378
ui_util_b8("", su->chan[i].flags1);
378379
ImGui::TableNextColumn();

0 commit comments

Comments
 (0)