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