Build: clicking a card's empty body selects the card
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
258b62a44a
commit
2241937eb2
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue