Skip to content

Commit

Permalink
digit tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Oct 20, 2024
1 parent 4f9ad30 commit 0ffcd6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/textual/demo2/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ class WidgetsScreen(PageScreen):

def compose(self) -> ComposeResult:
with containers.VerticalScroll():
with containers.Center(classes="column"):
yield Markdown(WIDGETS_MD)
yield Markdown(WIDGETS_MD, classes="column")
yield Buttons()
yield Checkboxes()
yield Datatables()
Expand Down
4 changes: 3 additions & 1 deletion src/textual/renderables/digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ class Digits:
"""

REPLACEMENTS = str.maketrans({".": "•"})

def __init__(self, text: str, style: StyleType = "") -> None:
self._text = text
self._style = style
Expand Down Expand Up @@ -202,7 +204,7 @@ def render(self, style: Style) -> RenderResult:
else:
digits = DIGITS3X3

for character in self._text:
for character in self._text.translate(self.REPLACEMENTS):
try:
position = DIGITS.index(character) * 3
except ValueError:
Expand Down

0 comments on commit 0ffcd6f

Please sign in to comment.