Skip to content

Commit 9529cac

Browse files
authored
Version 0.16.0 (#2106)
* snapshot * words * word update
1 parent 2a810f8 commit 9529cac

File tree

8 files changed

+309
-69
lines changed

8 files changed

+309
-69
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## Unreleased
8+
## [0.16.0] - 2023-03-22
99

1010
### Added
1111
- Added `parser_factory` argument to `Markdown` and `MarkdownViewer` constructors https://github.com/Textualize/textual/pull/2075
@@ -629,6 +629,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
629629
- New handler system for messages that doesn't require inheritance
630630
- Improved traceback handling
631631

632+
[0.16.0]: https://github.com/Textualize/textual/compare/v0.15.1...v0.16.0
632633
[0.15.1]: https://github.com/Textualize/textual/compare/v0.15.0...v0.15.1
633634
[0.15.0]: https://github.com/Textualize/textual/compare/v0.14.0...v0.15.0
634635
[0.14.0]: https://github.com/Textualize/textual/compare/v0.13.0...v0.14.0

docs/blog/images/border-title.svg

Lines changed: 170 additions & 0 deletions
Loading

docs/blog/posts/release0-16-0.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
draft: false
3+
date: 2023-03-22
4+
categories:
5+
- Release
6+
title: "Textual 0.16.0 adds TabbedContent and border titles"
7+
authors:
8+
- willmcgugan
9+
---
10+
11+
# Textual 0.16.0 adds TabbedContent and border titles
12+
13+
Textual 0.16.0 lands 9 days after the previous release. We have some new features to show you.
14+
15+
<!-- more -->
16+
17+
There are two highlights in this release. In no particular order, the first is [TabbedContent](../../widgets/tabbed_content.md) which uses a row of *tabs* to navigate content. You will have likely encountered this UI in the desktop and web. I think in Windows they are known as "Tabbed Dialogs".
18+
19+
This widget combines existing [Tabs](../../widgets/tabs.md) and [ContentSwitcher](../../api/content_switcher.md) widgets and adds an expressive interface for composing. Here's a trivial example to use content tabs to navigate a set of three markdown documents:
20+
21+
```python
22+
def compose(self) -> ComposeResult:
23+
with TabbedContent("Leto", "Jessica", "Paul"):
24+
yield Markdown(LETO)
25+
yield Markdown(JESSICA)
26+
yield Markdown(PAUL)
27+
```
28+
29+
Here's an example of the UI you can create with this widget (note the nesting)!
30+
31+
```{.textual path="docs/examples/widgets/tabbed_content.py" press="j"}
32+
```
33+
34+
35+
## Border titles
36+
37+
The second highlight is a frequently requests feature (FRF?). Widgets now have the two new string properties, `border_title` and `border_subtitle`, which will be displayed within the widget's border.
38+
39+
You can set the alignment of these titles via [`border-title-align`](../../styles/border_title_align.md) and [`border-subtitle-align`](../../styles/border_subtitle_align.md). Titles may contain [Console Markup](https://rich.readthedocs.io/en/latest/markup.html), so you can add additional color and style to the labels.
40+
41+
Here's an example of a widget with a title:
42+
43+
<div>
44+
--8<-- "docs/blog/images/border-title.svg"
45+
</div>
46+
47+
BTW the above is a command you can run to see the various border styles you can apply to widgets.
48+
49+
```
50+
textual borders
51+
```
52+
53+
## Container changes
54+
55+
!!! warning "Breaking change"
56+
57+
If you have an app that uses any container classes, you should read this section.
58+
59+
We've made a change to containers in this release. Previously all containers had *auto* scrollbars, which means that any container would scroll if its children didn't fit. With nested layouts, it could be tricky to understand exactly which containers were scrolling. In 0.16.0 we split containers in to scrolling and non-scrolling versions. So `Horizontal` will now *not* scroll by default, but `HorizontalScroll` will have automatic scrollbars.
60+
61+
62+
## What else?
63+
64+
As always, see the [release notes](https://github.com/Textualize/textual/releases/tag/v0.16.0) for the full details on this update.
65+
66+
If you want to talk about this update or anything else Textual related, join us on our [Discord server](https://discord.gg/Enf6Z3qhVr).

docs/styles/border_subtitle_align.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Border-subtitle-align
22

3-
The `border-subtitle-align` sets the horizontal alignment for the border subtitle.
3+
The `border-subtitle-align` rule sets the horizontal alignment for the border subtitle.
44

55
## Syntax
66

docs/styles/border_title_align.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Border-title-align
22

3-
The `border-title-align` sets the horizontal alignment for the border title.
3+
The `border-title-align` rule sets the horizontal alignment for the border title.
44

55
## Syntax
66

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "0.15.1"
3+
version = "0.16.0"
44
homepage = "https://github.com/Textualize/textual"
55
description = "Modern Text User Interface framework"
66
authors = ["Will McGugan <[email protected]>"]

src/textual/cli/previews/borders.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,19 @@ class BorderApp(App):
4646
height: auto;
4747
background: $panel;
4848
color: $text;
49+
border-title-align: center;
4950
}
5051
"""
5152

5253
def compose(self):
5354
yield BorderButtons()
5455
self.text = Label(TEXT, id="text")
5556
self.text.shrink = True
57+
self.text.border_title = "solid"
5658
yield self.text
5759

5860
def on_button_pressed(self, event: Button.Pressed) -> None:
61+
self.text.border_title = event.button.id
5962
self.text.styles.border = (
6063
event.button.id,
6164
self.stylesheet._variables["secondary"],

tests/snapshot_tests/__snapshots__/test_snapshots.ambr

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)