diff options
author | mathieui <mathieui@mathieui.net> | 2021-04-15 18:26:37 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-04-15 18:28:42 +0200 |
commit | 56bab711924cd7a660c874abf40fd545693f8d98 (patch) | |
tree | d4e0bff66b3e94231badc097af01487b45278587 /poezio/tabs | |
parent | b1b2ef860fbb6eaad63dae6fcb8a731ad595c474 (diff) | |
download | poezio-56bab711924cd7a660c874abf40fd545693f8d98.tar.gz poezio-56bab711924cd7a660c874abf40fd545693f8d98.tar.bz2 poezio-56bab711924cd7a660c874abf40fd545693f8d98.tar.xz poezio-56bab711924cd7a660c874abf40fd545693f8d98.zip |
fix: display issue when changing show_timestamps value
Diffstat (limited to 'poezio/tabs')
-rw-r--r-- | poezio/tabs/basetabs.py | 7 | ||||
-rw-r--r-- | poezio/tabs/conversationtab.py | 6 | ||||
-rw-r--r-- | poezio/tabs/muctab.py | 6 | ||||
-rw-r--r-- | poezio/tabs/privatetab.py | 4 | ||||
-rw-r--r-- | poezio/tabs/rostertab.py | 4 |
5 files changed, 17 insertions, 10 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 2046b866..51c34e62 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -124,12 +124,14 @@ class Tab: plugin_commands: Dict[str, Command] = {} plugin_keys: Dict[str, Callable] = {} # Placeholder values, set on resize - height = 1 - width = 1 + height: int = 1 + width: int = 1 core: Core input: Optional[windows.Input] key_func: Dict[str, Callable[[], Any]] commands: Dict[str, Command] + need_resize: bool + ui_config_changed: bool def __init__(self, core: Core): self.core = core @@ -142,6 +144,7 @@ class Tab: self._prev_state = None self.need_resize = False + self.ui_config_changed = False self.key_func = {} # each tab should add their keys in there # and use them in on_input self.commands = {} # and their own commands diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py index 873bf0d3..b8acfd8b 100644 --- a/poezio/tabs/conversationtab.py +++ b/poezio/tabs/conversationtab.py @@ -252,8 +252,10 @@ class ConversationTab(OneToOneTab): self.text_win.resize( self.height - 2 - bar_height - info_win_height - tab_win_height, - self.width, bar_height, 0) - self.text_win.rebuild_everything(self._text_buffer) + self.width, bar_height, 0, self._text_buffer, + force=self.ui_config_changed + ) + self.ui_config_changed = False if display_bar: self.upper_bar.resize(1, self.width, 0, 0) self.get_info_header().resize( diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index 566c1d2b..becabfc5 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -1268,8 +1268,8 @@ class MucTab(ChatTab): self.text_win.resize( self.height - 3 - info_win_height - tab_win_height, text_width, 1, - 0) - self.text_win.rebuild_everything(self._text_buffer) + 0, self._text_buffer, force=self.ui_config_changed) + self.ui_config_changed = False self.info_header.resize( 1, self.width, self.height - 2 - info_win_height - tab_win_height, 0) @@ -1314,7 +1314,7 @@ class MucTab(ChatTab): Tab.tab_win_height(), 1, 1, 9 * (self.width // 10)) self.text_win.resize( self.height - 3 - self.core.information_win_size - - Tab.tab_win_height(), text_width, 1, 0) + Tab.tab_win_height(), text_width, 1, 0, self._text_buffer) self.info_header.resize( 1, self.width, self.height - 2 - self.core.information_win_size - Tab.tab_win_height(), 0) diff --git a/poezio/tabs/privatetab.py b/poezio/tabs/privatetab.py index e24b5521..b07c7b65 100644 --- a/poezio/tabs/privatetab.py +++ b/poezio/tabs/privatetab.py @@ -214,8 +214,8 @@ class PrivateTab(OneToOneTab): self.text_win.resize( self.height - 2 - info_win_height - tab_win_height, self.width, 0, - 0) - self.text_win.rebuild_everything(self._text_buffer) + 0, self._text_buffer, force=self.ui_config_changed) + self.ui_config_changed = False self.info_header.resize( 1, self.width, self.height - 2 - info_win_height - tab_win_height, 0) diff --git a/poezio/tabs/rostertab.py b/poezio/tabs/rostertab.py index 6dd48726..66aff2b1 100644 --- a/poezio/tabs/rostertab.py +++ b/poezio/tabs/rostertab.py @@ -434,7 +434,9 @@ class RosterInfoTab(Tab): roster_width) self.information_win.resize( self.height - 1 - tab_win_height - contact_win_h, info_width, - 0, roster_width + 1, self.core.information_buffer) + 0, roster_width + 1, self.core.information_buffer, + force=self.ui_config_changed) + self.ui_config_changed = False if display_contact_win: y = self.height - tab_win_height - contact_win_h - 1 avatar_width = contact_win_h * 2 |