-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add a Unicode digits display widget #2916
Description
(This issue is reserved for the EuroPython 2023 sprint. If you are not participating in the sprint, please refrain from working on this issue. Thanks!)
This issue concerns itself with adding a new widget to Textual.
This widget should use Unicode box-drawing characters to create a display for digits.
Each digit should be drawn like shown below.
Digits
┏━┓
┃ ┃
┗━┛
┓
┃
╺┻╸
╺━┓
┏━┛
┗━╸
╺━┓
━┫
╺━┛
╻ ╻
┗━┫
╹
┏━╸
┗━┓
╺━┛
┏━╸
┣━┓
┗━┛
╺━┓
┃
┃
┏━┓
┣━┫
┗━┛
┏━┓
┗━┫
╺━┛
The widget should have a reactive attribute value that holds the integer value associated with the display.
To implement the actual display, you'll want to implement the method render.
See _progress_bar.py or _placeholder.py for two examples of widgets that implement the method render.
Take a look at #2333 to see what files need to be changed when you implement a new widget.
Then, don't be like me and also do the final step shown in #2399 to add your new widget to the widget gallery.
Good luck and have fun!