Skip to content

Commit

Permalink
Renamed 'Vertical' to 'VerticalScroll'.
Browse files Browse the repository at this point in the history
Related issues: #1957.
  • Loading branch information
rodrigogiraoserrao committed Mar 8, 2023
1 parent b6c5337 commit 8565d3c
Show file tree
Hide file tree
Showing 47 changed files with 121 additions and 127 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Updated styling to make it clear DataTable grows horizontally https://github.com/Textualize/textual/pull/1946
- Changed the `Checkbox` character due to issues with Windows Terminal and Windows 10 https://github.com/Textualize/textual/issues/1934
- Changed the `RadioButton` character due to issues with Windows Terminal and Windows 10 and 11 https://github.com/Textualize/textual/issues/1934
- Renamed `Vertical` to `VerticalScroll` https://github.com/Textualize/textual/issues/1957

### Added

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from random import randint
import time
from random import randint

from textual.app import App, ComposeResult
from textual.color import Color
from textual.containers import Grid, Vertical
from textual.containers import Grid, VerticalScroll
from textual.widget import Widget
from textual.widgets import Footer, Label

Expand All @@ -28,7 +28,7 @@ class MyApp(App[None]):
def compose(self) -> ComposeResult:
yield Grid(
ColourChanger(),
Vertical(id="log"),
VerticalScroll(id="log"),
)
yield Footer()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import asyncio
from random import randint
import time
from random import randint

from textual.app import App, ComposeResult
from textual.color import Color
from textual.containers import Grid, Vertical
from textual.containers import Grid, VerticalScroll
from textual.widget import Widget
from textual.widgets import Footer, Label

Expand All @@ -29,7 +29,7 @@ class MyApp(App[None]):
def compose(self) -> ComposeResult:
yield Grid(
ColourChanger(),
Vertical(id="log"),
VerticalScroll(id="log"),
)
yield Footer()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import asyncio
from random import randint
import time
from random import randint

from textual.app import App, ComposeResult
from textual.color import Color
from textual.containers import Grid, Vertical
from textual.containers import Grid, VerticalScroll
from textual.widget import Widget
from textual.widgets import Footer, Label

Expand All @@ -29,7 +29,7 @@ class MyApp(App[None]):
def compose(self) -> ComposeResult:
yield Grid(
ColourChanger(),
Vertical(id="log"),
VerticalScroll(id="log"),
)
yield Footer()

Expand Down
7 changes: 4 additions & 3 deletions docs/examples/events/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
raise ImportError("Please install httpx with 'pip install httpx' ")

from rich.json import JSON

from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.widgets import Static, Input
from textual.containers import VerticalScroll
from textual.widgets import Input, Static


class DictionaryApp(App):
Expand All @@ -18,7 +19,7 @@ class DictionaryApp(App):

def compose(self) -> ComposeResult:
yield Input(placeholder="Search for a word")
yield Vertical(Static(id="results"), id="results-container")
yield VerticalScroll(Static(id="results"), id="results-container")

async def on_input_changed(self, message: Input.Changed) -> None:
"""A coroutine to handle a text changed message."""
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/guide/layout/combining_layouts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from textual.app import App, ComposeResult
from textual.containers import Container, Horizontal, Vertical
from textual.containers import Container, Horizontal, VerticalScroll
from textual.widgets import Header, Static


Expand All @@ -9,7 +9,7 @@ class CombiningLayoutsExample(App):
def compose(self) -> ComposeResult:
yield Header()
with Container(id="app-grid"):
with Vertical(id="left-pane"):
with VerticalScroll(id="left-pane"):
for number in range(15):
yield Static(f"Vertical layout, child {number}")
with Horizontal(id="top-right"):
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/guide/layout/utility_containers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.containers import Horizontal, VerticalScroll
from textual.widgets import Static


Expand All @@ -8,12 +8,12 @@ class UtilityContainersExample(App):

def compose(self) -> ComposeResult:
yield Horizontal(
Vertical(
VerticalScroll(
Static("One"),
Static("Two"),
classes="column",
),
Vertical(
VerticalScroll(
Static("Three"),
Static("Four"),
classes="column",
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/guide/layout/utility_containers_using_with.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.containers import Horizontal, VerticalScroll
from textual.widgets import Static


Expand All @@ -8,10 +8,10 @@ class UtilityContainersExample(App):

def compose(self) -> ComposeResult:
with Horizontal():
with Vertical(classes="column"):
with VerticalScroll(classes="column"):
yield Static("One")
yield Static("Two")
with Vertical(classes="column"):
with VerticalScroll(classes="column"):
yield Static("Three")
yield Static("Four")

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/styles/height_comparison.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from textual.app import App
from textual.containers import Vertical
from textual.widgets import Placeholder, Label, Static
from textual.containers import VerticalScroll
from textual.widgets import Label, Placeholder, Static


class Ruler(Static):
Expand All @@ -11,7 +11,7 @@ def compose(self):

class HeightComparisonApp(App):
def compose(self):
yield Vertical(
yield VerticalScroll(
Placeholder(id="cells"), # (1)!
Placeholder(id="percent"),
Placeholder(id="w"),
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/styles/max_width.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from textual.app import App
from textual.containers import Vertical
from textual.containers import VerticalScroll
from textual.widgets import Placeholder


class MaxWidthApp(App):
def compose(self):
yield Vertical(
yield VerticalScroll(
Placeholder("max-width: 50h", id="p1"),
Placeholder("max-width: 999", id="p2"),
Placeholder("max-width: 50%", id="p3"),
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/styles/min_width.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Vertical {
VerticalScroll {
height: 100%;
width: 100%;
overflow-x: auto;
Expand All @@ -10,7 +10,8 @@ Placeholder {
}

#p1 {
min-width: 25%; /* (1)! */
min-width: 25%;
/* (1)! */
}

#p2 {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/styles/min_width.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from textual.app import App
from textual.containers import Vertical
from textual.containers import VerticalScroll
from textual.widgets import Placeholder


class MinWidthApp(App):
def compose(self):
yield Vertical(
yield VerticalScroll(
Placeholder("min-width: 25%", id="p1"),
Placeholder("min-width: 75%", id="p2"),
Placeholder("min-width: 100", id="p3"),
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/styles/overflow.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Screen {
color: black;
}

Vertical {
VerticalScroll {
width: 1fr;
}

Expand All @@ -13,7 +13,7 @@ Static {
border: green wide;
color: white 90%;
height: auto;
}
}

#right {
overflow-y: hidden;
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/styles/overflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from textual.app import App
from textual.containers import Horizontal, VerticalScroll
from textual.widgets import Static
from textual.containers import Horizontal, Vertical

TEXT = """I must not fear.
Fear is the mind-killer.
Expand All @@ -14,8 +14,8 @@
class OverflowApp(App):
def compose(self):
yield Horizontal(
Vertical(Static(TEXT), Static(TEXT), Static(TEXT), id="left"),
Vertical(Static(TEXT), Static(TEXT), Static(TEXT), id="right"),
VerticalScroll(Static(TEXT), Static(TEXT), Static(TEXT), id="left"),
VerticalScroll(Static(TEXT), Static(TEXT), Static(TEXT), id="right"),
)


Expand Down
4 changes: 2 additions & 2 deletions docs/examples/styles/scrollbar_size.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from textual.app import App
from textual.containers import Vertical
from textual.containers import VerticalScroll
from textual.widgets import Label

TEXT = """I must not fear.
Expand All @@ -14,7 +14,7 @@

class ScrollbarApp(App):
def compose(self):
yield Vertical(Label(TEXT * 5), classes="panel")
yield VerticalScroll(Label(TEXT * 5), classes="panel")


app = ScrollbarApp(css_path="scrollbar_size.css")
4 changes: 2 additions & 2 deletions docs/examples/styles/visibility_containers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from textual.app import App
from textual.containers import Horizontal, Vertical
from textual.containers import Horizontal, VerticalScroll
from textual.widgets import Placeholder


class VisibilityContainersApp(App):
def compose(self):
yield Vertical(
yield VerticalScroll(
Horizontal(
Placeholder(),
Placeholder(),
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/widgets/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Button {
margin: 1 2;
}

Horizontal > Vertical {
Horizontal>VerticalScroll {
width: 24;
}

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/widgets/button.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.containers import Horizontal, VerticalScroll
from textual.widgets import Button, Static


Expand All @@ -8,15 +8,15 @@ class ButtonsApp(App[str]):

def compose(self) -> ComposeResult:
yield Horizontal(
Vertical(
VerticalScroll(
Static("Standard Buttons", classes="header"),
Button("Default"),
Button("Primary!", variant="primary"),
Button.success("Success!"),
Button.warning("Warning!"),
Button.error("Error!"),
),
Vertical(
VerticalScroll(
Static("Disabled Buttons", classes="header"),
Button("Default", disabled=True),
Button("Primary!", variant="primary", disabled=True),
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/widgets/checkbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Screen {
align: center middle;
}

Vertical {
VerticalScroll {
width: auto;
height: auto;
border: solid $primary;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/widgets/checkbox.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.containers import VerticalScroll
from textual.widgets import Checkbox


class CheckboxApp(App[None]):
CSS_PATH = "checkbox.css"

def compose(self) -> ComposeResult:
with Vertical():
with VerticalScroll():
yield Checkbox("Arrakis :sweat:")
yield Checkbox("Caladan")
yield Checkbox("Chusuk")
Expand Down
5 changes: 2 additions & 3 deletions docs/examples/widgets/placeholder.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from textual.app import App, ComposeResult
from textual.containers import Container, Horizontal, Vertical
from textual.containers import Container, Horizontal, VerticalScroll
from textual.widgets import Placeholder


class PlaceholderApp(App):

CSS_PATH = "placeholder.css"

def compose(self) -> ComposeResult:
yield Vertical(
yield VerticalScroll(
Container(
Placeholder("This is a custom label for p1.", id="p1"),
Placeholder("Placeholder p2 here!", id="p2"),
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/widgets/radio_set_changed.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Vertical {
VerticalScroll {
align: center middle;
}

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/widgets/radio_set_changed.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.containers import Horizontal, VerticalScroll
from textual.widgets import Label, RadioButton, RadioSet


class RadioSetChangedApp(App[None]):
CSS_PATH = "radio_set_changed.css"

def compose(self) -> ComposeResult:
with Vertical():
with VerticalScroll():
with Horizontal():
with RadioSet():
yield RadioButton("Battlestar Galactica")
Expand Down
Loading

0 comments on commit 8565d3c

Please sign in to comment.