refactor: Remove status bar drag handle and allow dragging anywhere on top line
This commit is contained in:
parent
46760052d7
commit
ae1cd3ed96
19
gtm
19
gtm
|
|
@ -1016,16 +1016,15 @@ def draw_search_mode(stdscr, state: AppState, layout: StatusBarLayout):
|
|||
pass
|
||||
|
||||
def draw_resize_handle(stdscr, state: AppState, layout: StatusBarLayout):
|
||||
"""Draw the resize handle"""
|
||||
"""Draw the status bar height indicator (but no visible handle)"""
|
||||
try:
|
||||
handle_char = "≡" if state.dragging_status_bar else "="
|
||||
handle_text = handle_char * 5 # Make handle wider
|
||||
# Only show the number of lines when there are more than 2
|
||||
if state.status_bar_height > 2:
|
||||
handle_text += f" ({state.status_bar_height} lines)"
|
||||
handle_x = layout.screen_width // 2 - len(handle_text) // 2
|
||||
# Draw the handle on the main status line, but only if it won't overlap with other content
|
||||
if handle_x > 0 and handle_x + len(handle_text) < layout.screen_width:
|
||||
stdscr.addstr(layout.main_status_y, handle_x, handle_text, curses.A_REVERSE | curses.A_BOLD)
|
||||
height_text = f"({state.status_bar_height} lines)"
|
||||
height_x = layout.screen_width // 2 - len(height_text) // 2
|
||||
# Draw the height indicator on the main status line, but only if it won't overlap with other content
|
||||
if height_x > 0 and height_x + len(height_text) < layout.screen_width:
|
||||
stdscr.addstr(layout.main_status_y, height_x, height_text, curses.A_REVERSE | curses.A_BOLD)
|
||||
except curses.error:
|
||||
pass
|
||||
|
||||
|
|
@ -1204,8 +1203,8 @@ def handle_mouse_input(stdscr, state: AppState) -> AppState:
|
|||
if bstate & curses.BUTTON1_PRESSED:
|
||||
if state.show_sidebar and abs(mx - state.divider_col) <= 1:
|
||||
return replace(state, dragging_divider=True)
|
||||
elif my == status_bar_start and abs(mx - (state.width // 2)) <= 3:
|
||||
# Clicked on the status bar handle (wider click area)
|
||||
elif my == status_bar_start:
|
||||
# Clicked anywhere on the top line of the status bar
|
||||
return replace(state, dragging_status_bar=True)
|
||||
else:
|
||||
focus = "right"
|
||||
|
|
|
|||
Loading…
Reference in New Issue