-
Notifications
You must be signed in to change notification settings - Fork 815
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4441 from Textualize/margin-fix
fix margins
- Loading branch information
Showing
8 changed files
with
226 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,17 @@ jobs: | |
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
# Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64) | ||
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760 | ||
exclude: | ||
- { python-version: "3.8", os: "macos-latest" } | ||
- { python-version: "3.9", os: "macos-latest" } | ||
- { python-version: "3.11", os: "macos-latest" } | ||
include: | ||
- { python-version: "3.8", os: "macos-13" } | ||
- { python-version: "3.9", os: "macos-13" } | ||
- { python-version: "3.11", os: "macos-13" } | ||
defaults: | ||
run: | ||
shell: bash | ||
|
@@ -32,18 +43,18 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'poetry' | ||
cache: "poetry" | ||
- name: Install dependencies | ||
run: poetry install --no-interaction --extras syntax | ||
if: ${{ matrix.python-version != '3.12' }} | ||
- name: Install dependencies for 3.12 # https://github.com/Textualize/textual/issues/3491#issuecomment-1854156476 | ||
- name: Install dependencies for 3.12 # https://github.com/Textualize/textual/issues/3491#issuecomment-1854156476 | ||
run: poetry install --no-interaction | ||
if: ${{ matrix.python-version == '3.12' }} | ||
- name: Test with pytest | ||
run: | | ||
poetry run pytest tests -v --cov=./src/textual --cov-report=xml:./coverage.xml --cov-report term-missing | ||
if: ${{ matrix.python-version != '3.12' }} | ||
- name: Test with pytest for 3.12 # https://github.com/Textualize/textual/issues/3491#issuecomment-1854156476 | ||
- name: Test with pytest for 3.12 # https://github.com/Textualize/textual/issues/3491#issuecomment-1854156476 | ||
run: | | ||
poetry run pytest tests -v --cov=./src/textual --cov-report=xml:./coverage.xml --cov-report term-missing -m 'not syntax' | ||
if: ${{ matrix.python-version == '3.12' }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from textual.app import App, ComposeResult | ||
from textual.containers import Container, ScrollableContainer, Horizontal | ||
from textual.widgets import Label | ||
|
||
|
||
class CompoundWidget(ScrollableContainer): | ||
DEFAULT_CSS = """ | ||
#inner { | ||
width: 1fr; | ||
background: $panel; | ||
align: center middle; | ||
margin: 5; | ||
border: green; | ||
} | ||
Label { | ||
border: double yellow; | ||
} | ||
""" | ||
|
||
def compose(self) -> ComposeResult: | ||
yield Label("foo") | ||
with Container(id="inner"): | ||
yield Label("bar") | ||
|
||
|
||
class MyApp(App): | ||
CSS = """ | ||
#widget2 > Label { | ||
display: none; | ||
} | ||
""" | ||
|
||
def compose(self) -> ComposeResult: | ||
with Horizontal(): | ||
yield CompoundWidget(id="widget1") | ||
yield CompoundWidget(id="widget2") | ||
|
||
|
||
if __name__ == "__main__": | ||
MyApp().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters