Chaining click events (double/triple click etc) (#5369)

* Add comment about Click events

* Remove unused `App._hover_effects_timer`

* Add missing annotation

* Add missing type annotation

* Add `App._click_chain_timer`

* Add support for click chaining (double click, triple click, etc.)

* Create `App.CLICK_CHAIN_TIME_THRESHOLD` for controlling click chain timing

* Some tests for chained clicks

* Test changes [no ci]

* Have Pilot send only MouseUp and MouseDown, and let Textual generate clicks itself [no ci]

* Fix DataTable click tet [no ci]

* Rename Click.count -> Click.chain

* Test fixes

* Enhance raw_click function documentation in test_app.py to clarify its purpose and behavior

* Refactor imports in events.py: remove Self from typing and import from typing_extensions

* Remove unnecessary pause in test_datatable_click_cell_cursor

* Remove debug print statements and unnecessary pause in App class; add on_mount method to LazyApp for better lifecycle management in tests

* Remove debugging prints

* Add support for double and triple clicks in testing guide

* Add a note about double and triple clicks to the docs

* Turn off formatter for a section of code, and make it 3.8 compatible

* Update changelog [no ci]

* Simplify by removing an unecessary variable in `Pilot.click`

* Remove debugging code

* Add target-version py38 to ruff config in pyproject.toml, and remove formatter comments

* Document timing of click chains

* Pilot.double_click and Pilot.triple_click
This commit is contained in:
Darren Burns
2024-12-11 16:25:42 +00:00
committed by GitHub
parent 268971e27c
commit 3c120c0ab0
9 changed files with 380 additions and 34 deletions

View File

@@ -40,6 +40,9 @@ include = [
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/Textualize/textual/issues"
[tool.ruff]
target-version = "py38"
[tool.poetry.dependencies]
python = "^3.8.1"
markdown-it-py = { extras = ["plugins", "linkify"], version = ">=2.1.0" }