diff --git a/.gitignore b/.gitignore index f809597..ac8437c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +.idea/ +.venv/ + +ait/ caesium.cfg idec.db __pycache__ +lasts.lst diff --git a/caesium.py b/caesium.py index 25dfded..9f7222a 100755 --- a/caesium.py +++ b/caesium.py @@ -432,6 +432,10 @@ def get_term_size(): height, width = stdscr.getmaxyx() def draw_title(y, x, title): + x = max(0, x) + if (x + len(title) + 2) > width: + title = title[:width - x - 2 - 3] + '...' + # if bold[0]: color = curses.color_pair(1) + curses.A_BOLD else: @@ -1766,21 +1770,24 @@ def msg_list(echoarea, msgids, msgn): check_directories() load_lasts() stdscr = curses.initscr() -curses.start_color() -curses.use_default_colors() -load_colors() -curses.noecho() -curses.curs_set(False) -stdscr.keypad(True) - -stdscr.bkgd(" ", curses.color_pair(1)) -get_term_size() -if show_splash: - splash_screen() -draw_message_box("Подождите", False) -get_counts() -stdscr.clear() -echo_selector() -curses.echo() -curses.curs_set(True) -curses.endwin() +try: + curses.start_color() + curses.use_default_colors() + load_colors() + curses.noecho() + curses.curs_set(False) + stdscr.keypad(True) + + stdscr.bkgd(" ", curses.color_pair(1)) + get_term_size() + if show_splash: + splash_screen() + draw_message_box("Подождите", False) + get_counts() + stdscr.clear() + echo_selector() +finally: + curses.echo() + curses.curs_set(True) + stdscr.keypad(False) + curses.endwin() diff --git a/themes/white.cfg b/themes/white.cfg index 0af2ed1..5b5f7af 100644 --- a/themes/white.cfg +++ b/themes/white.cfg @@ -14,4 +14,4 @@ url blue white header red white statusline white cyan scrollbar cyan white -origin blue whie \ No newline at end of file +origin blue white