console: grideditors don't display their own titles anymore

This commit is contained in:
Aldo Cortesi 2017-06-10 10:09:48 +12:00
parent 040238e255
commit 2054739c1e

View File

@ -280,12 +280,6 @@ class BaseGridEditor(urwid.WidgetWrap):
first_width = max(len(r), first_width) first_width = max(len(r), first_width)
self.first_width = min(first_width, FIRST_WIDTH_MAX) self.first_width = min(first_width, FIRST_WIDTH_MAX)
title = None
if self.title:
title = urwid.Text(self.title)
title = urwid.Padding(title, align="left", width=("relative", 100))
title = urwid.AttrWrap(title, "heading")
headings = [] headings = []
for i, col in enumerate(self.columns): for i, col in enumerate(self.columns):
c = urwid.Text(col.heading) c = urwid.Text(col.heading)
@ -301,10 +295,7 @@ class BaseGridEditor(urwid.WidgetWrap):
self.walker = GridWalker(self.value, self) self.walker = GridWalker(self.value, self)
self.lb = GridListBox(self.walker) self.lb = GridListBox(self.walker)
w = urwid.Frame( w = urwid.Frame(self.lb)
self.lb,
header=urwid.Pile([title, h]) if title else None
)
super().__init__(w) super().__init__(w)
signals.footer_help.send(self, helptext="") signals.footer_help.send(self, helptext="")
self.show_empty_msg() self.show_empty_msg()