feat: Make entire status bar reverse-video with active pane percentage in normal video
This commit is contained in:
parent
a87c324020
commit
96f7b80226
12
gtm2.py
12
gtm2.py
|
|
@ -380,18 +380,18 @@ def draw_status_bars(stdscr, state):
|
|||
# Use terminal's default colors for the status bar
|
||||
status_attr = curses.A_NORMAL # Use terminal's default colors
|
||||
|
||||
# Fill the status bar with spaces
|
||||
# Fill the status bar with spaces using reverse video
|
||||
for x in range(state.width - 1):
|
||||
try:
|
||||
stdscr.addch(state.height - 1, x, ' ', status_attr)
|
||||
stdscr.addch(state.height - 1, x, ' ', curses.A_REVERSE)
|
||||
except curses.error:
|
||||
pass
|
||||
|
||||
# Add left percentage indicator (only if sidebar is visible)
|
||||
if state.show_sidebar:
|
||||
try:
|
||||
# Use reverse video if left pane is active
|
||||
left_attr = curses.A_REVERSE if state.focus == "left" else status_attr
|
||||
# Use normal video if left pane is active (since status bar is already reverse)
|
||||
left_attr = status_attr if state.focus == "left" else curses.A_REVERSE
|
||||
# Add a space before and after the percentage with the same highlighting
|
||||
stdscr.addstr(state.height - 1, 0, f" {left_status} ", left_attr)
|
||||
except curses.error:
|
||||
|
|
@ -422,8 +422,8 @@ def draw_status_bars(stdscr, state):
|
|||
padded_right_status = f" {right_status} "
|
||||
right_x = state.width - len(padded_right_status)
|
||||
if right_x >= 0:
|
||||
# Use reverse video if right pane is active
|
||||
right_attr = curses.A_REVERSE if state.focus == "right" else status_attr
|
||||
# Use normal video if right pane is active (since status bar is already reverse)
|
||||
right_attr = status_attr if state.focus == "right" else curses.A_REVERSE
|
||||
stdscr.addstr(state.height - 1, right_x, padded_right_status, right_attr)
|
||||
except curses.error:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Reference in New Issue