Remove unused SizeManager argument, and simplify its import.
This commit is contained in:
parent
968ed665f6
commit
d19f53c3e9
2 changed files with 5 additions and 6 deletions
|
@ -104,7 +104,7 @@ class Core(object):
|
|||
self.plugin_manager = PluginManager(self)
|
||||
self.events = events.EventHandler()
|
||||
|
||||
self.size = SizeManager(self, windows.Win)
|
||||
self.size = SizeManager(self)
|
||||
|
||||
# Set to True whenever we consider that we have been disconnected
|
||||
# from the server because of a legitimate reason (bad credentials,
|
||||
|
|
|
@ -4,7 +4,7 @@ Size Manager:
|
|||
specific tabs
|
||||
"""
|
||||
|
||||
from poezio import windows
|
||||
from poezio.windows import base_wins
|
||||
|
||||
THRESHOLD_WIDTH_DEGRADE = 45
|
||||
THRESHOLD_HEIGHT_DEGRADE = 10
|
||||
|
@ -14,18 +14,17 @@ FULL_HEIGHT_DEGRADE = 10
|
|||
|
||||
class SizeManager(object):
|
||||
|
||||
def __init__(self, core, win_cls):
|
||||
self._win_class = win_cls
|
||||
def __init__(self, core):
|
||||
self._core = core
|
||||
|
||||
@property
|
||||
def tab_degrade_x(self):
|
||||
_, x = windows.base_wins.TAB_WIN.getmaxyx()
|
||||
_, x = base_wins.TAB_WIN.getmaxyx()
|
||||
return x < THRESHOLD_WIDTH_DEGRADE
|
||||
|
||||
@property
|
||||
def tab_degrade_y(self):
|
||||
y, x = windows.base_wins.TAB_WIN.getmaxyx()
|
||||
y, x = base_wins.TAB_WIN.getmaxyx()
|
||||
return y < THRESHOLD_HEIGHT_DEGRADE
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in a new issue