mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
* feat: add rule widget * add star to init Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * remove unnecessary validations * update rule styles * add tests for invalid rules * add minimum heights and widths * tidy up examples * remove old example * move examples styling to tcss * modify examples to fit docs screenshots * add docs first draft * add snapshot tests * add rule to widget gallery * make non-widget rule classes available * tentatively update changelog --------- Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> Co-authored-by: Will McGugan <willmcgugan@gmail.com>
28 lines
917 B
Python
28 lines
917 B
Python
from textual.app import App, ComposeResult
|
|
from textual.widgets import Rule, Label
|
|
from textual.containers import Horizontal
|
|
|
|
|
|
class VerticalRulesApp(App):
|
|
CSS_PATH = "vertical_rules.tcss"
|
|
|
|
def compose(self) -> ComposeResult:
|
|
with Horizontal():
|
|
yield Label("solid")
|
|
yield Rule(orientation="vertical")
|
|
yield Label("heavy")
|
|
yield Rule(orientation="vertical", line_style="heavy")
|
|
yield Label("thick")
|
|
yield Rule(orientation="vertical", line_style="thick")
|
|
yield Label("dashed")
|
|
yield Rule(orientation="vertical", line_style="dashed")
|
|
yield Label("double")
|
|
yield Rule(orientation="vertical", line_style="double")
|
|
yield Label("ascii")
|
|
yield Rule(orientation="vertical", line_style="ascii")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app = VerticalRulesApp()
|
|
app.run()
|