Make style configurable

This commit is contained in:
Digital Studium 2024-12-26 10:47:19 +03:00
parent 19b9f8b639
commit 4206509d19
1 changed files with 2 additions and 1 deletions

3
kls
View File

@ -77,6 +77,7 @@ ROWS_HEIGHT: int = curses.LINES - HEADER_HEIGHT - FOOTER_HEIGHT - 3
# Generate HELP_TEXT from KEY_BINDINGS # Generate HELP_TEXT from KEY_BINDINGS
HELP_TEXT: str = ", ".join(f"{key}: {binding['description']}" for key, binding in KEY_BINDINGS.items()) HELP_TEXT: str = ", ".join(f"{key}: {binding['description']}" for key, binding in KEY_BINDINGS.items())
HELP_TEXT += ", /: filter mode, Esc: exit filter mode or kls, arrows/TAB/PgUp/PgDn: navigation" HELP_TEXT += ", /: filter mode, Esc: exit filter mode or kls, arrows/TAB/PgUp/PgDn: navigation"
SELECTED_ROW_STYLE = curses.A_REVERSE | curses.A_BOLD
# **************************** # # **************************** #
# END OF CONFIGURATION SECTION # # END OF CONFIGURATION SECTION #
@ -122,7 +123,7 @@ selected_menu: Optional[Menu] = None
def draw_row(window: curses.window, text: str, y: int, x: int, selected: bool = False) -> None: def draw_row(window: curses.window, text: str, y: int, x: int, selected: bool = False) -> None:
window.addstr(y, x, text, curses.A_REVERSE | curses.A_BOLD if selected else curses.A_NORMAL) window.addstr(y, x, text, SELECTED_ROW_STYLE if selected else curses.A_NORMAL)
window.clrtoeol() window.clrtoeol()
window.refresh() window.refresh()