Correct a problem with tables at very small widths
Gertty would crash if the screen was narrower than the widest column in a table. This corrects that. Change-Id: Ie0a2c6fae16c7c484edb6724fa5dd5f79065e94f
This commit is contained in:
parent
844634b2f6
commit
349c5b2a62
@ -40,8 +40,9 @@ class FixedButton(urwid.Button):
|
||||
|
||||
class TableColumn(urwid.Pile):
|
||||
def pack(self, size, focus=False):
|
||||
maxcol = size[0]
|
||||
mx = max([len(i[0].text) for i in self.contents])
|
||||
return (mx+2, len(self.contents))
|
||||
return (min(mx+2, maxcol), len(self.contents))
|
||||
|
||||
class Table(urwid.WidgetWrap):
|
||||
def __init__(self, headers=[], columns=None):
|
||||
|
Loading…
x
Reference in New Issue
Block a user