Fixed a few typos.

This commit is contained in:
Michael Lazar
2016-04-15 18:22:55 -07:00
parent 6c130001b1
commit 47af24cc6e
2 changed files with 5 additions and 4 deletions

View File

@@ -351,8 +351,9 @@ class Page(object):
subwin_n_rows = min(available_rows, data['n_rows']) subwin_n_rows = min(available_rows, data['n_rows'])
subwin_inverted = inverted subwin_inverted = inverted
if top_item_height is not None: if top_item_height is not None:
# Special case when top_item_height is given. This will only # Special case: draw the page as non-inverted, except for the
# be applied to the first item that is drawn. # top element. This element will be drawn as inverted with a
# restricted height
subwin_n_rows = min(subwin_n_rows, top_item_height) subwin_n_rows = min(subwin_n_rows, top_item_height)
subwin_inverted = True subwin_inverted = True
top_item_height = None top_item_height = None
@@ -419,7 +420,7 @@ class Page(object):
if self.nav.cursor_index >= len(self._subwindows): if self.nav.cursor_index >= len(self._subwindows):
self.nav.cursor_index = len(self._subwindows) - 1 self.nav.cursor_index = len(self._subwindows) - 1
window, attr, _ = self._subwindows[self.nav.cursor_index] window, attr = self._subwindows[self.nav.cursor_index]
if attr is not None: if attr is not None:
attribute |= attr attribute |= attr

View File

@@ -38,7 +38,7 @@ class SubmissionPage(Page):
# ensure that when we re-draw the page, the cursor stays at its # ensure that when we re-draw the page, the cursor stays at its
# current absolute position. Do this by turning off inversion and # current absolute position. Do this by turning off inversion and
# applying an offset to the top item. # applying an offset to the top item.
window = self._subwindows[-1] window = self._subwindows[-1][0]
n_rows, _ = window.getmaxyx() n_rows, _ = window.getmaxyx()
self.nav.flip(len(self._subwindows) - 1) self.nav.flip(len(self._subwindows) - 1)
self.nav.top_item_height = n_rows self.nav.top_item_height = n_rows