This commit is contained in:
Will McGugan 2021-03-29 10:37:25 +01:00
parent e4d5eda74b
commit a28cf3a97e
2 changed files with 3 additions and 3 deletions

View file

@ -131,7 +131,7 @@ To implement your own columns, extend the :class:`~rich.progress.ProgressColumn`
Table Columns
~~~~~~~~~~~~~
Rich builds a :class:`~rich.table.Table` for the tasks in the Progress instance. You can customize how the columns of this *tasks table* are created by specifying the `table_column` argument in the Column constructor, which should be a :class:`~rich.table.Column` instance.
Rich builds a :class:`~rich.table.Table` for the tasks in the Progress instance. You can customize how the columns of this *tasks table* are created by specifying the ``table_column`` argument in the Column constructor, which should be a :class:`~rich.table.Column` instance.
The following example demonstrates a progress bar where the description takes one third of the width of the terminal, and the bar takes up the remaining third::

View file

@ -25,13 +25,13 @@ class Constrain(JupyterMixin):
if self.width is None:
yield self.renderable
else:
child_options = options.update(width=min(self.width, options.max_width))
child_options = options.update_width(min(self.width, options.max_width))
yield from console.render(self.renderable, child_options)
def __rich_measure__(
self, console: "Console", options: "ConsoleOptions"
) -> "Measurement":
if self.width is not None:
max_width = min(self.width, options.max_width)
options = options.update_width(self.width)
measurement = Measurement.get(console, options, self.renderable)
return measurement