Merge pull request #532 from Textualize/box-fix

Box fix
This commit is contained in:
Will McGugan
2022-05-20 14:14:42 +01:00
committed by GitHub
3 changed files with 8 additions and 12 deletions

View File

@@ -40,7 +40,7 @@ App > Screen {
background: $primary-darken-2;
color: $text-primary-darken-2 ;
border-right: outer $primary-darken-3;
content-align: center middle;
content-align: center middle;
}
#sidebar .user {
@@ -168,7 +168,7 @@ OptionItem {
height: 3;
background: $primary;
border-right: outer $primary-darken-2;
border-left: hidden;
border-left: blank;
content-align: center middle;
}
@@ -223,4 +223,4 @@ Success {
.horizontal {
layout: horizontal
}
}

View File

@@ -15,4 +15,4 @@ Horizontal {
align: center middle;
box-sizing: content-box;
}
}

View File

@@ -22,7 +22,7 @@ OUTER = 2
BORDER_CHARS: dict[EdgeType, tuple[str, str, str]] = {
# Each string of the tuple represents a sub-tuple itself:
# - 1st string represents `(top1, top2, top3)`
# - 1st string represents (top1, top2, top3)
# - 2nd string represents (mid1, mid2, mid3)
# - 3rd string represents (bottom1, bottom2, bottom3)
"": (" ", " ", " "),
@@ -128,7 +128,7 @@ class Border:
This is analogous to Rich's `Box` but more flexible. Different borders may be
applied to each of the four edges, and more advanced borders can be achieved through
varions combinations of Widget and parent background colors.
various combinations of Widget and parent background colors.
"""
@@ -150,12 +150,8 @@ class Border:
(bottom, bottom_color),
(left, left_color),
) = edge_styles
self._sides: tuple[EdgeType, EdgeType, EdgeType, EdgeType] = (
top or "none",
right or "none",
bottom or "none",
left or "none",
)
self._sides: tuple[EdgeType, EdgeType, EdgeType, EdgeType]
self._sides = (top, right, bottom, left)
from_color = Style.from_color
self._styles = (