Skip to content

Commit 5adfbe5

Browse files
authored
Merge pull request #5335 from Textualize/tab-border
added tab border style
2 parents 5ef3af1 + 93f823f commit 5adfbe5

File tree

8 files changed

+259
-67
lines changed

8 files changed

+259
-67
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## Unreleased
99

10+
## Added
11+
12+
- Added "tab" border style https://github.com/Textualize/textual/pull/5335
13+
1014
## Changed
1115

1216
- Fixed Select not scrolling highlight in to view when clicked https://github.com/Textualize/textual/issues/5255

src/textual/_border.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@
107107
("▊", " ", "▎"),
108108
("▊", "▁", "▎"),
109109
),
110+
"tab": (
111+
("▁", "▁", "▁"),
112+
("▎", " ", "▊"),
113+
("▔", "▔", "▔"),
114+
),
110115
"wide": (
111116
("▁", "▁", "▁"),
112117
("▎", " ", "▊"),
@@ -205,6 +210,11 @@
205210
(2, 0, 1),
206211
(2, 0, 1),
207212
),
213+
"tab": (
214+
(1, 1, 1),
215+
(0, 1, 3),
216+
(1, 1, 1),
217+
),
208218
"wide": (
209219
(1, 1, 1),
210220
(0, 1, 3),
@@ -215,7 +225,10 @@
215225
# Some borders (such as panel) require that the title (and subtitle) be draw in reverse.
216226
# This is a mapping of the border type on to a tuple for the top and bottom borders, to indicate
217227
# reverse colors is required.
218-
BORDER_TITLE_FLIP: dict[str, tuple[bool, bool]] = {"panel": (True, False)}
228+
BORDER_TITLE_FLIP: dict[str, tuple[bool, bool]] = {
229+
"panel": (True, False),
230+
"tab": (True, True),
231+
}
219232

220233
# In a similar fashion, we extract the border _label_ locations for easier access when
221234
# rendering a border label.
@@ -343,6 +356,7 @@ def render_border_label(
343356
cells_reserved = 2 * corners_needed
344357

345358
text_label, label_style = label
359+
346360
if not text_label.cell_len or width <= cells_reserved:
347361
return
348362

src/textual/css/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"round",
2323
"solid",
2424
"tall",
25+
"tab",
2526
"thick",
2627
"vkey",
2728
"wide",

src/textual/css/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"hkey",
2525
"vkey",
2626
"tall",
27+
"tab",
2728
"panel",
2829
"wide",
2930
]

src/textual/widgets/_footer.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ class FooterKey(Widget):
4747
}
4848
4949
&.-disabled {
50-
text-style: dim;
51-
&:hover {
52-
.footer-key--key {
53-
background: $foreground-disabled;
54-
}
55-
}
50+
text-style: dim;
5651
}
5752
5853
&.-compact {
Lines changed: 152 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)