summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-03-25 22:11:49 +0100
committermathieui <mathieui@mathieui.net>2021-04-02 17:44:36 +0200
commit2c12a598aa1efaae89932b3af18c45a0c50b8445 (patch)
tree7f2a14dfe98c3b34f20cc8262ebf36d9f63870d4
parent43d84a22882a7a4362e3df6fd71d74d296297fe7 (diff)
downloadpoezio-2c12a598aa1efaae89932b3af18c45a0c50b8445.tar.gz
poezio-2c12a598aa1efaae89932b3af18c45a0c50b8445.tar.bz2
poezio-2c12a598aa1efaae89932b3af18c45a0c50b8445.tar.xz
poezio-2c12a598aa1efaae89932b3af18c45a0c50b8445.zip
fix: do not use raw TAB_WIN in bookmarks wins
(wth)
-rw-r--r--poezio/tabs/bookmarkstab.py3
-rw-r--r--poezio/windows/bookmark_forms.py8
2 files changed, 4 insertions, 7 deletions
diff --git a/poezio/tabs/bookmarkstab.py b/poezio/tabs/bookmarkstab.py
index 986e0b9d..4b7f708b 100644
--- a/poezio/tabs/bookmarkstab.py
+++ b/poezio/tabs/bookmarkstab.py
@@ -36,8 +36,7 @@ class BookmarksTab(Tab):
self.header_win = windows.ColumnHeaderWin(
['name', 'room@server/nickname', 'password', 'autojoin',
'storage'])
- self.bookmarks_win = windows.BookmarksWin(
- self.bookmarks, self.height - 4, self.width, 1, 0)
+ self.bookmarks_win = windows.BookmarksWin(self.bookmarks)
self.help_win = windows.HelpText('Ctrl+Y: save, Ctrl+G: cancel, '
'↑↓: change lines, tab: change '
'column, M-a: add bookmark, C-k'
diff --git a/poezio/windows/bookmark_forms.py b/poezio/windows/bookmark_forms.py
index 10851b3b..b8a60763 100644
--- a/poezio/windows/bookmark_forms.py
+++ b/poezio/windows/bookmark_forms.py
@@ -155,8 +155,8 @@ class BookmarksWin(Win):
__slots__ = ('scroll_pos', '_current_input', 'current_horizontal_input',
'_bookmarks', 'lines')
- def __init__(self, bookmarks: BookmarkList, height: int, width: int, y: int, x: int) -> None:
- self._win = base_wins.TAB_WIN.derwin(height, width, y, x)
+ def __init__(self, bookmarks: BookmarkList) -> None:
+ Win.__init__(self)
self.scroll_pos = 0
self._current_input = 0
self.current_horizontal_input = 0
@@ -214,9 +214,7 @@ class BookmarksWin(Win):
return bm
def resize(self, height: int, width: int, y: int, x: int) -> None:
- self.height = height
- self.width = width
- self._win = base_wins.TAB_WIN.derwin(height, width, y, x)
+ super().resize(height, width, y, x)
# Adjust the scroll position, if resizing made the window too small
# for the cursor to be visible
while self.current_input - self.scroll_pos > self.height - 1: