retronews

a featureful fork of the luke8086/retronews hn+lobste.rs tui
Log | Files | Refs | README | LICENSE

commit b56c57d80f91b5d725bafd74d96d8bf3d157b2bf
parent 98ca1d878e19974881552b27cb64b3034496f239
Author: luke8086 <55237178+luke8086@users.noreply.github.com>
Date:   Sat, 30 Jul 2022 21:07:42 +0000

Display page number on the right side of the bottom menu

Diffstat:
Mretronews.py | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/retronews.py b/retronews.py @@ -771,14 +771,13 @@ def app_render_bottom_menu(app: AppState) -> None: app.screen.move(lt.bottom_menu_row, 0) for (i, group) in enumerate(GROUP_TABS): - attr = app.colors.menu | curses.A_BOLD - text = f"{i+1}:{group.label}" + is_active = group.provider == app.group.provider and group.name == app.group.name + color = app.colors.menu_active if is_active else app.colors.menu + attr = color | curses.A_BOLD + app.screen.addstr(f"{i+1}:{group.label} ", attr) - if group.provider == app.group.provider and group.name == app.group.name: - attr = app.colors.menu_active | curses.A_BOLD - text = f"{text} ({app.group.page})" - - app.screen.addstr(f"{text} ", attr) + page_text = f"page: {app.group.page}" + app.screen.insstr(lt.bottom_menu_row, lt.cols - len(page_text), page_text, app.colors.menu | curses.A_BOLD) def app_update_layout(app: AppState) -> None: