Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Toggleable footer via config #670

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rtv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ def _parse_rtv_file(config):
'max_comment_cols': partial(config.getint, 'rtv'),
'max_pager_cols': partial(config.getint, 'rtv'),
'hide_username': partial(config.getboolean, 'rtv'),
'flash': partial(config.getboolean, 'rtv')
'flash': partial(config.getboolean, 'rtv'),
'show_footer': partial(config.getboolean, 'rtv')
}

for key, func in params.items():
Expand Down
5 changes: 3 additions & 2 deletions rtv/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,8 @@ def draw(self):
self._draw_header()
self._draw_banner()
self._draw_content()
self._draw_footer()
if self.config['show_footer']:
self._draw_footer()
self.term.clear_screen()
self.term.stdscr.refresh()

Expand Down Expand Up @@ -775,7 +776,7 @@ def _draw_content(self):
Loop through submissions and fill up the content page.
"""
n_rows, n_cols = self.term.stdscr.getmaxyx()
window = self.term.stdscr.derwin(n_rows - self._row - 1, n_cols, self._row, 0)
window = self.term.stdscr.derwin(n_rows - self._row - (1 if self.config['show_footer'] else 0), n_cols, self._row, 0)
window.erase()
win_n_rows, win_n_cols = window.getmaxyx()

Expand Down
3 changes: 3 additions & 0 deletions rtv/templates/rtv.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ max_comment_cols = 120
; Maximum number of columns for pager
;max_pager_cols = 70

; Show the keybinds help bar at the bottom of the screen
show_footer = True

; Hide username if logged in, display "Logged in" instead
hide_username = False

Expand Down