feat: Add mouse state details to status bar for debugging
This commit is contained in:
parent
a0a5e722b3
commit
8156da7632
9
gtm2.py
9
gtm2.py
|
|
@ -121,6 +121,7 @@ class AppState:
|
|||
self.is_selecting = False
|
||||
self.selection_start_coord = None
|
||||
self.selection_end_coord = None
|
||||
self.last_bstate = 0
|
||||
|
||||
def update_dimensions(self, height, width):
|
||||
self.height = height
|
||||
|
|
@ -313,7 +314,12 @@ def draw_status_bars(stdscr, state):
|
|||
left_percent = 0
|
||||
left_status = f"{left_percent}%"
|
||||
if state.enable_mouse:
|
||||
left_status += " [M]"
|
||||
mouse_status = f" [M] b:{state.last_bstate}"
|
||||
if state.dragging_divider:
|
||||
mouse_status += " DIV"
|
||||
elif state.is_selecting:
|
||||
mouse_status += " SEL"
|
||||
left_status += mouse_status
|
||||
|
||||
left_attr = curses.color_pair(1) if state.focus == "left" else curses.color_pair(2)
|
||||
right_attr = curses.color_pair(1) if state.focus == "right" else curses.color_pair(2)
|
||||
|
|
@ -376,6 +382,7 @@ def copy_selection_to_clipboard(stdscr, state):
|
|||
def handle_mouse_input(stdscr, state):
|
||||
try:
|
||||
_, mx, my, _, bstate = curses.getmouse()
|
||||
state.last_bstate = bstate
|
||||
|
||||
# If a drag/selection is in progress
|
||||
if state.is_selecting or state.dragging_divider:
|
||||
|
|
|
|||
Loading…
Reference in New Issue