fix: Prevent multiple mouse drag actions and restore pane switching
This commit is contained in:
parent
66940d44f9
commit
f527ba4c36
14
gtm2.py
14
gtm2.py
|
|
@ -378,12 +378,14 @@ def handle_mouse_input(stdscr, state):
|
|||
_, mx, my, _, bstate = curses.getmouse()
|
||||
|
||||
if bstate & curses.BUTTON1_PRESSED:
|
||||
if abs(mx - state.divider_col) <= 1:
|
||||
state.dragging_divider = True
|
||||
else:
|
||||
state.is_selecting = True
|
||||
state.selection_start_coord = (mx, my)
|
||||
state.selection_end_coord = (mx, my)
|
||||
# Only start a new action if no action is in progress
|
||||
if not state.dragging_divider and not state.is_selecting:
|
||||
if abs(mx - state.divider_col) <= 1:
|
||||
state.dragging_divider = True
|
||||
else:
|
||||
state.is_selecting = True
|
||||
state.selection_start_coord = (mx, my)
|
||||
state.selection_end_coord = (mx, my)
|
||||
|
||||
if state.dragging_divider:
|
||||
state.update_divider(mx)
|
||||
|
|
|
|||
Loading…
Reference in New Issue