diff options
Diffstat (limited to 'poezio/size_manager.py')
-rw-r--r-- | poezio/size_manager.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/poezio/size_manager.py b/poezio/size_manager.py index 3e80c357..c5312c9f 100644 --- a/poezio/size_manager.py +++ b/poezio/size_manager.py @@ -18,21 +18,25 @@ class SizeManager: self._core = core @property - def tab_degrade_x(self): + def tab_degrade_x(self) -> bool: + if base_wins.TAB_WIN is None: + raise ValueError _, x = base_wins.TAB_WIN.getmaxyx() return x < THRESHOLD_WIDTH_DEGRADE @property - def tab_degrade_y(self): + def tab_degrade_y(self) -> bool: + if base_wins.TAB_WIN is None: + raise ValueError y, x = base_wins.TAB_WIN.getmaxyx() return y < THRESHOLD_HEIGHT_DEGRADE @property - def core_degrade_x(self): + def core_degrade_x(self) -> bool: y, x = self._core.stdscr.getmaxyx() return x < FULL_WIDTH_DEGRADE @property - def core_degrade_y(self): + def core_degrade_y(self) -> bool: y, x = self._core.stdscr.getmaxyx() return y < FULL_HEIGHT_DEGRADE |