feat: Improve pane switching by handling mouse press event immediately
This commit is contained in:
parent
b0a142e90c
commit
d22b9ff5b9
9
gtm2.py
9
gtm2.py
|
|
@ -449,13 +449,16 @@ def handle_mouse_input(stdscr, state):
|
|||
if abs(mx - state.divider_col) <= 1:
|
||||
state.dragging_divider = True
|
||||
else:
|
||||
# Start a new selection
|
||||
# Switch panes immediately on click
|
||||
state.focus = "left" if mx < state.divider_col else "right"
|
||||
|
||||
# Also start a potential selection (in case this becomes a drag)
|
||||
state.is_selecting = True
|
||||
state.selection_start_coord = (mx, my)
|
||||
state.selection_end_coord = (mx, my)
|
||||
# Store the click position for later comparison
|
||||
state.click_position = (mx, my)
|
||||
# Redraw immediately to show selection highlight
|
||||
|
||||
# Redraw immediately to show selection highlight and focus change
|
||||
draw_ui(stdscr, state)
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue