mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
box fix
This commit is contained in:
@@ -109,7 +109,6 @@ Tweet {
|
|||||||
|
|
||||||
.code {
|
.code {
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ def test_width():
|
|||||||
def get_auto_width(container: Size, parent: Size) -> int:
|
def get_auto_width(container: Size, parent: Size) -> int:
|
||||||
return 10
|
return 10
|
||||||
|
|
||||||
def get_auto_height(container: Size, parent: Size) -> int:
|
def get_auto_height(container: Size, parent: Size, width: int) -> int:
|
||||||
return 10
|
return 10
|
||||||
|
|
||||||
box_model = get_box_model(
|
box_model = get_box_model(
|
||||||
@@ -139,6 +139,15 @@ def test_height():
|
|||||||
)
|
)
|
||||||
assert box_model == BoxModel(Fraction(54), Fraction(20), Spacing(1, 2, 3, 4))
|
assert box_model == BoxModel(Fraction(54), Fraction(20), Spacing(1, 2, 3, 4))
|
||||||
|
|
||||||
|
styles.height = "auto"
|
||||||
|
styles.margin = 2
|
||||||
|
|
||||||
|
box_model = get_box_model(
|
||||||
|
styles, Size(60, 20), Size(80, 24), one, get_auto_width, get_auto_height
|
||||||
|
)
|
||||||
|
assert box_model == BoxModel(Fraction(54), Fraction(16), Spacing(1, 2, 3, 4))
|
||||||
|
|
||||||
|
styles.margin = None
|
||||||
styles.height = "100vh"
|
styles.height = "100vh"
|
||||||
styles.max_height = "50%"
|
styles.max_height = "50%"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user