fix: Prevent resize handle from overwriting commit details
This commit is contained in:
parent
a8ac9c1e85
commit
ecb59fa6c4
6
gtm
6
gtm
|
|
@ -998,7 +998,9 @@ def draw_resize_handle(stdscr, state: AppState, layout: StatusBarLayout):
|
|||
if state.status_bar_height > 2:
|
||||
handle_text += f" ({state.status_bar_height} lines)"
|
||||
handle_x = layout.screen_width // 2 - len(handle_text) // 2
|
||||
stdscr.addstr(layout.main_status_y, handle_x, handle_text, curses.A_REVERSE | curses.A_BOLD)
|
||||
# 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)
|
||||
except curses.error:
|
||||
pass
|
||||
|
||||
|
|
@ -1014,8 +1016,8 @@ def draw_status_bars(stdscr, state):
|
|||
draw_commit_details(stdscr, state, layout)
|
||||
else:
|
||||
draw_main_status_line(stdscr, state, layout)
|
||||
draw_resize_handle(stdscr, state, layout) # Draw handle before commit details
|
||||
draw_commit_details(stdscr, state, layout)
|
||||
draw_resize_handle(stdscr, state, layout)
|
||||
|
||||
def draw_ui(stdscr, state):
|
||||
stdscr.erase()
|
||||
|
|
|
|||
Loading…
Reference in New Issue