9 Commits

Author SHA1 Message Date
Dave Pearson
f45df6a0b4 Add a test for getting a message when changing collapsible via reactive
This is currently a failing test; work relating to #3869 should make this
pass.
2024-03-04 10:16:46 +00:00
Dave Pearson
6b96f20611 Correct a Collapsible's test description 2024-03-04 10:04:17 +00:00
Dave Pearson
79341a5b4c Add a test for getting a message when changing collapsible via reactive
This is currently a failing test; work relating to #3869 should make this
pass.
2024-03-04 09:50:05 +00:00
Dave Pearson
49b03d5412 Correct a Collapsible's test description 2024-03-04 09:38:50 +00:00
Dave Pearson
f0dfa4c1db Tidy up a couple of typing issues in the Collapsible tests 2024-03-04 09:24:00 +00:00
TomJGooding
e72bab31a4 feat(collapsible): make title a reactive attribute (#3830)
* feat(collapsible): make title a reactive attribute

* update docs and changelog

* fix collapsed in init

* change collapsible title to static

* remove unnecessary mounted check
2023-12-15 10:39:42 +00:00
Rodrigo Girão Serrão
880fc89cd0 Add Collapsible.Toggled. (#3825)
Add Collapsible.Toggled, Collapsible.Expanded, and Collapsible.Collapsed.
2023-12-07 16:09:45 +00:00
Will McGugan
1db9ecb302 Update Collapsible (#3305)
* Update Collapsible

* snapshot tests

* word

* Update docs/widgets/collapsible.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update docs/widgets/collapsible.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* simplify render

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-09-14 16:26:41 +01:00
Sunyoung Yoo
3b2b9aaaf5 Widget collapsible (#2989)
* Collapsible container widget.

* Expose collapsible widget.

* Add collapsible container example

* Rename member variables as label and apply formatting

* Apply hover effect

* Apply formatting

* Add collapsible construction example with children.

* Wrap contents within Container and move _collapsed flag to Collapsible class from  Summary for easier access.

* Add collapsible example that is expanded by default.

* Update collapsed property to be reactive

* Add footer to collapse and expand all with bound keys.

* Expose summary property of Collapsible

* Assign ids of ollapsed, expanded label instead of classes

* Add unit tests of Collapsible

* Rename class Summary to Title

* Rename variables of expanded/collapsed symbols and add it to arguments..

* Add documentation for Collapsible

* Update symbol ids of Collapsible title

* Update src/textual/widgets/_collapsible.py

Correct import path

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Sort module names in alphabetical order

* Clarify that collapsible is non-focusable in documentation.

* Add version hint

* Fix documentation of Collapsible.

* Add snapshot test for collapsible widget

* Stop on click event from Collapsible.

* Handle Title.Toggle event to prevent event in Contents from propagating to the children or parents Collapsible widgets.

* Update Collapsible default css to have 1 fraction of width instead of 100%

* Update Collapsible custom symbol snapshot

* Add Collapsible custom symbol snapshot as an example

* Update docs/widgets/collapsible.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update src/textual/widgets/_collapsible.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Fix typo in Collapsible docs

* Rework collapsible documentation.

---------

Co-authored-by: Sunyoung Yoo <luysunyoung@aifactory.page>
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-09-14 13:10:21 +01:00