ImDebugger: Clickable addresses in the Threads window, highlight the current thread

A selectable spanning all columns took the clicks of the addresses after it,
unless it allows overlap. Same fix for the Atrac, utility module and symbol
module tables, which have a checkbox or clickable address after one. The
current thread's row gets a green tint.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-19 11:14:15 +02:00
1 parent 6c0400d8db
commit 8ed0c8692c
1 file changed
+9 -4
+9 -4
View File
@@ -494,11 +494,16 @@ void DrawThreadView(ImConfig &cfg, ImControl &control) {
for (int i = 0; i < (int)info.size(); i++) {
const DebugThreadInfo &thread = info[i];
ImGui::TableNextRow();
if (thread.isCurrent) {
// A green tint, to stand apart from the blue selection.
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg1, IM_COL32(40, 160, 70, 70));
}
ImGui::PushID(i);
ImGui::TableNextColumn();
ImGui::Text("%d", thread.id);
ImGui::TableNextColumn();
if (ImGui::Selectable(thread.name, cfg.selectedThread == i, ImGuiSelectableFlags_AllowDoubleClick | ImGuiSelectableFlags_SpanAllColumns)) {
// AllowOverlap keeps the clickable addresses in the other columns working.
if (ImGui::Selectable(thread.name, cfg.selectedThread == i, ImGuiSelectableFlags_AllowDoubleClick | ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap)) {
cfg.selectedThread = i;
}
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
@@ -1400,7 +1405,7 @@ void DrawMediaDecodersView(ImConfig &cfg, ImControl &control) {
ImGui::SetNextItemAllowOverlap();
char temp[16];
snprintf(temp, sizeof(temp), "%d", i);
if (ImGui::Selectable(temp, i == cfg.selectedAtracCtx, ImGuiSelectableFlags_SpanAllColumns)) {
if (ImGui::Selectable(temp, i == cfg.selectedAtracCtx, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap)) {
cfg.selectedAtracCtx = i;
}
ImGui::TableNextColumn();
@@ -2209,7 +2214,7 @@ static void DrawUtilityModules(ImConfig &cfg, ImControl &control) {
ImGui::PushID(i);
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGui::Selectable(info->name, cfg.selectedUtilityModule == i, ImGuiSelectableFlags_SpanAllColumns)) {
if (ImGui::Selectable(info->name, cfg.selectedUtilityModule == i, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap)) {
cfg.selectedUtilityModule = i;
}
ImGui::TableNextColumn();
@@ -2359,7 +2364,7 @@ static void DrawSymbols(const MIPSDebugInterface *debug, ImConfig &cfg, ImContro
ImGui::PushID(i);
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGui::Selectable(module.name.c_str(), cfg.selectedSymbolModule == i, ImGuiSelectableFlags_SpanAllColumns)) {
if (ImGui::Selectable(module.name.c_str(), cfg.selectedSymbolModule == i, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap)) {
cfg.selectedSymbolModule = i;
}
ImGui::TableNextColumn();