Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions consolemenu/menu_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def calculate_content_width(self):
Returns:
int: the inner content width in columns.
"""
return self.calculate_border_width() - self.padding.left - self.padding.right - 2
return max(self.calculate_border_width() - self.padding.left - self.padding.right - 2, 1)

def generate(self):
"""
Expand Down Expand Up @@ -236,8 +236,8 @@ def _format_content(self, content='', align='left'):
return '{lp}{text:{al}{width}}{rp}'.format(lp=' ' * self.padding.left,
rp=' ' * self.padding.right,
text=content, al=self._alignment_char(align),
width=(self.calculate_border_width() - self.padding.left -
self.padding.right - 2 + invisible_chars))
width=max(self.calculate_border_width() - self.padding.left -
self.padding.right - 2 + invisible_chars, 0))


class MenuHeader(MenuComponent):
Expand Down