Simplify windows setup

pull/102/head
Ivan Habunek 2019-04-23 13:31:17 +02:00
rodzic 9e8a127087
commit b9743ba268
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
1 zmienionych plików z 12 dodań i 7 usunięć

Wyświetl plik

@ -8,7 +8,7 @@ from toot import __version__, api
from toot.exceptions import ConsoleError from toot.exceptions import ConsoleError
from toot.ui.parsers import parse_status from toot.ui.parsers import parse_status
from toot.ui.utils import draw_horizontal_divider, draw_lines, size_as_drawn from toot.ui.utils import draw_horizontal_divider, draw_lines, size_as_drawn
from toot.wcstring import fit_text, wc_wrap from toot.wcstring import fit_text
# Attempt to load curses, which is not available on windows # Attempt to load curses, which is not available on windows
try: try:
@ -500,13 +500,18 @@ class TimelineApp:
if screen_width < 60: if screen_width < 60:
raise ConsoleError("Terminal screen is too narrow, toot curses requires at least 60 columns to display properly.") raise ConsoleError("Terminal screen is too narrow, toot curses requires at least 60 columns to display properly.")
left_width = max(min(screen_width // 3, 60), 30) header_height = 2
right_width = screen_width - left_width footer_height = 2
footer_top = screen_height - footer_height
self.header = HeaderWindow(self.stdscr, 2, screen_width, 0, 0) left_width = max(min(screen_width // 3, 60), 30)
self.footer = FooterWindow(self.stdscr, 2, screen_width, screen_height - 2, 0) main_height = screen_height - header_height - footer_height
self.left = StatusListWindow(self.stdscr, screen_height - 4, left_width, 2, 0) main_width = screen_width - left_width
self.right = StatusDetailWindow(self.stdscr, screen_height - 4, right_width, 2, left_width)
self.header = HeaderWindow(self.stdscr, header_height, screen_width, 0, 0)
self.footer = FooterWindow(self.stdscr, footer_height, screen_width, footer_top, 0)
self.left = StatusListWindow(self.stdscr, main_height, left_width, header_height, 0)
self.right = StatusDetailWindow(self.stdscr, main_height, main_width, header_height, left_width)
self.help_modal = HelpModal(self.stdscr) self.help_modal = HelpModal(self.stdscr)