From 2241937eb27c9648a7481376484ac6b267153430 Mon Sep 17 00:00:00 2001 From: tachyonwolf Date: Sat, 21 Nov 2026 09:03:20 -0600 Subject: [PATCH] Build: clicking a card's empty body selects the card Co-Authored-By: Claude Sonnet 5.5 --- ui/table_card_input.gd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/table_card_input.gd b/ui/table_card_input.gd index ab1a15b..fabb174 100644 --- a/ui/table_card_input.gd +++ b/ui/table_card_input.gd @@ -15,6 +15,10 @@ func gui_input(ev: InputEvent) -> void: # ends, so scrolling past the last result doesn't start zooming. var mb := ev as InputEventMouseButton if mb and mb.button_index == MOUSE_BUTTON_LEFT: + # In Build, a click on the card's own body (no control took it) selects the card. + # (A click on a result row already selected that result; leave it.) + if mb.pressed and card.main.mode == Main.Mode.BUILD and not _is_inspected(): + card.main.select_card(card.table.id) card.accept_event() elif mb and _wheel_in_list(mb): card.accept_event() @@ -22,6 +26,12 @@ func gui_input(ev: InputEvent) -> void: card.accept_event() +## True when the inspector already shows this card or one of its results. +func _is_inspected() -> bool: + var selection := card.main.inspector_selection() + return str(selection.get("tid", "")) == card.table.id and str(selection.get("kind", "")) != "pipe" + + func _wheel_in_list(mb: InputEventMouseButton) -> bool: if mb.button_index != MOUSE_BUTTON_WHEEL_UP and mb.button_index != MOUSE_BUTTON_WHEEL_DOWN: return false