Make all of the change view scrollable
Which makes better use of vertical space. Also, tuck the votes box in under the change info (so it doesn't start below a very long commit message -- that wastes a lot of space). Change-Id: Ia7d216ce584221fa5055e1a7e5e6fba1ed94b399
This commit is contained in:
parent
68c51ffdb7
commit
0415539a9f
|
@ -272,18 +272,21 @@ This Screen
|
||||||
change_info.append(row)
|
change_info.append(row)
|
||||||
change_info = urwid.Pile(change_info)
|
change_info = urwid.Pile(change_info)
|
||||||
self.commit_message = urwid.Text(u'')
|
self.commit_message = urwid.Text(u'')
|
||||||
top = urwid.Columns([change_info, ('weight', 1, self.commit_message)])
|
|
||||||
votes = mywid.Table([])
|
votes = mywid.Table([])
|
||||||
|
self.left_column = urwid.Pile([('pack', change_info),
|
||||||
|
('pack', urwid.Divider()),
|
||||||
|
('pack', votes)])
|
||||||
|
top = urwid.Columns([self.left_column, ('weight', 1, self.commit_message)])
|
||||||
|
|
||||||
self.listbox = urwid.ListBox(urwid.SimpleFocusListWalker([]))
|
self.listbox = urwid.ListBox(urwid.SimpleFocusListWalker([]))
|
||||||
self._w.contents.append((self.app.header, ('pack', 1)))
|
self._w.contents.append((self.app.header, ('pack', 1)))
|
||||||
self._w.contents.append((urwid.Divider(), ('pack', 1)))
|
self._w.contents.append((urwid.Divider(), ('pack', 1)))
|
||||||
self._w.contents.append((top, ('pack', None)))
|
|
||||||
self._w.contents.append((urwid.Divider(), ('pack', 1)))
|
|
||||||
self._w.contents.append((votes, ('pack', None)))
|
|
||||||
self._w.contents.append((urwid.Divider(), ('pack', 1)))
|
|
||||||
self._w.contents.append((self.listbox, ('weight', 1)))
|
self._w.contents.append((self.listbox, ('weight', 1)))
|
||||||
self._w.set_focus(6)
|
self._w.set_focus(2)
|
||||||
|
|
||||||
|
self.listbox.body.append(top)
|
||||||
|
self.listbox.body.append(urwid.Divider())
|
||||||
|
self.listbox_patchset_start = len(self.listbox.body)
|
||||||
|
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
|
@ -337,13 +340,13 @@ This Screen
|
||||||
# TODO: update the existing table rather than replacing it
|
# TODO: update the existing table rather than replacing it
|
||||||
# wholesale. It will become more important if the table
|
# wholesale. It will become more important if the table
|
||||||
# gets selectable items (like clickable names).
|
# gets selectable items (like clickable names).
|
||||||
self._w.contents[4] = (votes, ('pack', None))
|
self.left_column.contents[2] = (votes, ('pack', None))
|
||||||
|
|
||||||
repo = self.app.getRepo(change.project.name)
|
repo = self.app.getRepo(change.project.name)
|
||||||
# The listbox has both revisions and messages in it (and
|
# The listbox has both revisions and messages in it (and
|
||||||
# may later contain the vote table and change header), so
|
# may later contain the vote table and change header), so
|
||||||
# keep track of the index separate from the loop.
|
# keep track of the index separate from the loop.
|
||||||
listbox_index = 0
|
listbox_index = self.listbox_patchset_start
|
||||||
for revno, revision in enumerate(change.revisions):
|
for revno, revision in enumerate(change.revisions):
|
||||||
row = self.revision_rows.get(revision.key)
|
row = self.revision_rows.get(revision.key)
|
||||||
if not row:
|
if not row:
|
||||||
|
|
Loading…
Reference in New Issue