* Add get_child_by_id and get_widget_by_id
* Remove redundant code
* Add unit tests for app-level get_child_by_id and get_widget_by_id
* Remove redundant test fixture injection
* Update CHANGELOG
* Enforce uniqueness of ID amongst widget children
* Enforce unique widget IDs amongst widgets mounted together
* Update CHANGELOG.md
* Ensuring unique IDs in a more logical place
* Add docstring to NodeList._get_by_id
* Dont use duplicate IDs in tests, dont mount 2000 widgets
* Mounting less widgets in a unit test
* Reword error message
* Use lower-level depth first search in get_widget_by_id to break out early
* Improvements to width:auto HorizontalLayout
* Fix HorizontalLayout.get_content_width
* Horizontal width auto improvement
* Removing some printxz
* Update snapshot for horizontal layout width auto dock
This seeks to address #1175, where a containing widget with a transparent
background, but with a border, won't show the border. It seems that at the
heart of the Compositor it's taking `is_transparent` (of the widget) as one
of the indicators that mean that it won't be visible. This wouldn't normally
be the case, in that a widget could be transparent (in the background) but
could have visible content.
Note that some snapshot tests failed with this change, but no material
difference was found in those failing snapshot tests.
Adds a method to Widget that allows moving a child of that widget within its
list of children. Options are to move before or after a specific location,
or a sibling widget.
Seeks to implement #1121.
These tests are designed to give 100% coverage to the App._on_remove method,
which is the heart of the widget removal system. This is done in
anticipation to some reworking as part of #1094.
Note that, for the moment, there's a bit of a hack in here. These tests need
the pilot. The pilot would need that we await changes to the DOM. Removing
things from the DOM changes the DOM. Remove can't be awaited (see above
change that's coming). So... until such a time as we can await a remove, we
go with a simple await of asyncio.sleep to get things started.
Once #1094 has been done these tests should all still work fine *and* we
should be able to await the removes rather than use the sleeps.
Because some changes are going to be made to the way that removal of widgets
happens, and because this will affect the linkage between parents and
children, and because we don't want the current way of working to change...
extend to the tests to be sure that when an unmount happens a widget has no
children any more, but still knows about its parent.
This was waiting for the update to query_one that would raise an exception
if the result had more than one match. That's in Textual now so we can
finally add this test.
* Fix containers not being focusable
* Fix tests to allow for focusable containers
* Add test for non-focusable container with focusable children
* Fix a typo in a test
* Support multiple CSS paths
* Update a type to match docstring
* Ensure the demo app still works
* Use absolute paths in tests to (hopefully) appease Windows
* Notes about CSS changes in guide/docstrings, small grammar/typos fixes
* Move snapshot apps into snapshot_tests dir, improve messaging in snapshot output, add test for multiple css files interacting with classvar CSS
* Ensure consistent snapshot naming cross-platform
* Use rpartition instead of partition in import_app
* Fix handling of import_app when colon in arg
* Support paths containing Windows drive names in import_app
* Add note on new relative paths in snap_compare
* Update docs/guide/CSS.md
Co-authored-by: Will McGugan <willmcgugan@gmail.com>
* Fix formatting
* Update CHANGELOG to mention CSS_PATH supporting a list
Co-authored-by: Will McGugan <willmcgugan@gmail.com>