From b259f817791d14da4bd71362b785daf50f53d329 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Thu, 18 Dec 2025 10:00:04 +0000 Subject: [PATCH 1/2] version bump --- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/textual/events.py | 4 ++++ src/textual/screen.py | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 462b3bebe1..c6043af721 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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/). +## [6.11.0] - 2025-12-18 + +### Added + +- Added a TextSelected event. + ## [6.10.0] - 2025-12-16 ### Fixed @@ -3246,6 +3252,8 @@ 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 +[6.11.0]: https://github.com/Textualize/textual/compare/v6.10.0...v6.11.0 +[6.10.0]: https://github.com/Textualize/textual/compare/v6.9.0...v6.10.0 [6.9.0]: https://github.com/Textualize/textual/compare/v6.8.0...v6.9.0 [6.8.0]: https://github.com/Textualize/textual/compare/v6.7.1...v6.8.0 [6.7.1]: https://github.com/Textualize/textual/compare/v6.7.0...v6.7.1 diff --git a/pyproject.toml b/pyproject.toml index 8d9c3be28d..9a0c582945 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "textual" -version = "6.10.0" +version = "6.11.0" homepage = "https://github.com/Textualize/textual" repository = "https://github.com/Textualize/textual" documentation = "https://textual.textualize.io/" diff --git a/src/textual/events.py b/src/textual/events.py index 29271cb1ab..b1d79d8d34 100644 --- a/src/textual/events.py +++ b/src/textual/events.py @@ -976,3 +976,7 @@ class DeliveryFailed(Event, bubble=False): name: str | None = None """Optional name returned to the app to identify the download.""" + + +class TextSelected(Event, bubble=True): + """Sent from the screen when text is selected (Not Input and TextArea)""" diff --git a/src/textual/screen.py b/src/textual/screen.py index 61d38376f0..b21f964d8a 100644 --- a/src/textual/screen.py +++ b/src/textual/screen.py @@ -1698,6 +1698,7 @@ def _forward_event(self, event: events.Event) -> None: self.clear_selection() self._mouse_down_offset = None self._selecting = False + self.post_message(events.TextSelected()) elif isinstance(event, events.MouseDown) and not self.app.mouse_captured: self._box_select = event.shift From 9324669032a49d95443866a5798f5e3490b839fe Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Thu, 18 Dec 2025 10:00:44 +0000 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6043af721..6aa2248a71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added -- Added a TextSelected event. +- Added a `TextSelected` event. https://github.com/Textualize/textual/pull/6290 ## [6.10.0] - 2025-12-16