Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Textualize/textual into themes
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Oct 28, 2024
2 parents 6ad521d + ca923f7 commit 796a6ae
Show file tree
Hide file tree
Showing 78 changed files with 3,359 additions and 1,797 deletions.
41 changes: 40 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,47 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
## [0.85.1] - 2024-10-26

### Fixed

- Fixed encoding issue when saving files such as screenshots on Windows https://github.com/Textualize/textual/pull/5182

## [0.85.0] - 2024-10-25

### Changed

- Grid will now size children to the maximum height of a row https://github.com/Textualize/textual/pull/5113
- Markdown links will be opened with `App.open_url` automatically https://github.com/Textualize/textual/pull/5113
- The universal selector (`*`) will now not match widgets with the class `-textual-system` (scrollbars, notifications etc) https://github.com/Textualize/textual/pull/5113
- Renamed `Screen.can_view` and `Widget.can_view` to `Screen.can_view_entire` and `Widget.can_view_entire` https://github.com/Textualize/textual/pull/5174

### Added

- Added Link widget https://github.com/Textualize/textual/pull/5113
- Added `open_links` to `Markdown` and `MarkdownViewer` widgets https://github.com/Textualize/textual/pull/5113
- Added `App.DEFAULT_MODE` https://github.com/Textualize/textual/pull/5113
- Added `Containers.HorizontalGroup` and `Containers.VerticalGroup` https://github.com/Textualize/textual/pull/5113
- Added `$`, `£`, ``, `(`, `)` symbols to Digits https://github.com/Textualize/textual/pull/5113
- Added `Button.action` parameter to invoke action when clicked https://github.com/Textualize/textual/pull/5113
- Added `immediate` parameter to scroll methods https://github.com/Textualize/textual/pull/5164
- Added `textual._loop.loop_from_index` https://github.com/Textualize/textual/pull/5164
- Added `min_color` and `max_color` to Sparklines constructor, which take precedence over CSS https://github.com/Textualize/textual/pull/5174
- Added new demo `python -m textual`, not *quite* finished but better than the old one https://github.com/Textualize/textual/pull/5174
- Added `Screen.can_view_partial` and `Widget.can_view_partial` https://github.com/Textualize/textual/pull/5174
- Added `App.is_web` property to indicate if the app is running via a web browser https://github.com/Textualize/textual/pull/5128
- `Enter` and `Leave` events can now be used with the `on` decorator https://github.com/Textualize/textual/pull/5159

### Fixed

- Fixed glitchy ListView https://github.com/Textualize/textual/issues/5163

## [0.84.0] - 2024-10-22

### Fixed

- Fixed `RadioSet` not being scrollable https://github.com/Textualize/textual/issues/5100
- Fixed infinite loop in TextArea https://github.com/Textualize/textual/pull/5154

### Added

Expand Down Expand Up @@ -2453,6 +2489,9 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
- New handler system for messages that doesn't require inheritance
- Improved traceback handling

[0.85.1]: https://github.com/Textualize/textual/compare/v0.85.0...v0.85.1
[0.85.0]: https://github.com/Textualize/textual/compare/v0.84.0...v0.85.0
[0.84.0]: https://github.com/Textualize/textual/compare/v0.83.0...v0.84.0
[0.83.0]: https://github.com/Textualize/textual/compare/v0.82.0...v0.83.0
[0.82.0]: https://github.com/Textualize/textual/compare/v0.81.0...v0.82.0
[0.81.0]: https://github.com/Textualize/textual/compare/v0.80.1...v0.81.0
Expand Down
6 changes: 6 additions & 0 deletions docs/api/layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "textual.layout"
---


::: textual.layout
23 changes: 23 additions & 0 deletions docs/examples/widgets/link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from textual.app import App, ComposeResult
from textual.widgets import Link


class LabelApp(App):
AUTO_FOCUS = None
CSS = """
Screen {
align: center middle;
}
"""

def compose(self) -> ComposeResult:
yield Link(
"Go to textualize.io",
url="https://textualize.io",
tooltip="Click me",
)


if __name__ == "__main__":
app = LabelApp()
app.run()
5 changes: 0 additions & 5 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ Once you have Textual installed, run the following to get an impression of what
python -m textual
```

If Textual is installed you should see the following:

```{.textual path="src/textual/demo.py" columns="127" lines="53" press="enter,tab,w,i,l,l"}
```

## Examples


Expand Down
7 changes: 7 additions & 0 deletions docs/widget_gallery.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ A simple text label.
[Label reference](./widgets/label.md){ .md-button .md-button--primary }


## Link

A clickable link that opens a URL.

[Link reference](./widgets/link.md){ .md-button .md-button--primary }


## ListView

Display a list of items (items may be other widgets).
Expand Down
61 changes: 61 additions & 0 deletions docs/widgets/link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Link

!!! tip "Added in version 0.84.0"

A widget to display a piece of text that opens a URL when clicked, like a web browser link.

- [x] Focusable
- [ ] Container


## Example

A trivial app with a link.
Clicking the link open's a web-browser—as you might expect!

=== "Output"

```{.textual path="docs/examples/widgets/link.py"}
```

=== "link.py"

```python
--8<-- "docs/examples/widgets/link.py"
```


## Reactive Attributes

| Name | Type | Default | Description |
| ------ | ----- | ------- | ----------------------------------------- |
| `text` | `str` | `""` | The text of the link. |
| `url` | `str` | `""` | The URL to open when the link is clicked. |


## Messages

This widget sends no messages.

## Bindings

The Link widget defines the following bindings:

::: textual.widgets.Link.BINDINGS
options:
show_root_heading: false
show_root_toc_entry: false


## Component classes

This widget contains no component classes.



---


::: textual.widgets.Link
options:
heading_level: 2
2 changes: 2 additions & 0 deletions mkdocs-nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ nav:
- "widgets/index.md"
- "widgets/input.md"
- "widgets/label.md"
- "widgets/link.md"
- "widgets/list_item.md"
- "widgets/list_view.md"
- "widgets/loading_indicator.md"
Expand Down Expand Up @@ -195,6 +196,7 @@ nav:
- "api/filter.md"
- "api/fuzzy_matcher.md"
- "api/geometry.md"
- "api/layout.md"
- "api/lazy.md"
- "api/logger.md"
- "api/logging.md"
Expand Down
Loading

0 comments on commit 796a6ae

Please sign in to comment.