A couple of things come with this, at least one being a breaking change of
sorts:
- DirectoryTree now has a path attribute
- DirectoryTree.path is a reactive
- When DirectoryTree.path is assigned to it rebuilds the tree content
- DirectoryTree.path can be assigned a str or Path but always evaluates to a Path
- DirEntry.path is now typed as a Path
- DirEntry drops is_dir (Directory.path.is_dir() does that job)
- DirectoryTree.FileSelected.path is now always a Path
This is the first of what might be a few changes here; the main thrust of
this commit being to allow changing a DirectoryTree to view a different
directory, and also to move to a Path-first approach.
This is a series of tests for checking styles that have sub-styles, or
sub-parts, or whatever the correct name would be; the testing being that if
!important is applied to the whole, that it works.
Starting with #2420 it became apparent that this didn't work as intended,
and once that work started it became obvious that it affected more than just
border.
So these tests test all of the styles that can be specified as a single
whole, or as a set of parts (sides, directions, etc).
See https://github.com/Textualize/textual/pull/2442#issuecomment-1529512891
This changes the original PR so that, rather than calling a private watcher
instead of a public, as originally issued, we now call public and private,
if they're both there.
If they are both there private is called first.
This change allows for private watch methods. By convention they start with
an underscore. If a reactive or var has a private watch method, it will be
used in preference to a public watch method.
With this change it becomes easier to have a private reactive/var whose
watcher is also private. For example:
_counter = var(0)
"""This is a private counter, it won't appear in the docs."
...
def _watch__counter(self) -> None:
"""Watch _counter, but don't appear in the docs either."
...
See #2382.
Currently, in the various TreeNode messages, and the handlers you'd write to
handle them, there's no way to easily know *which* tree sent the message and
so which tree the node belongs to.
This commit adds public access to the tree reference to the nodes, so that
in an event handler the developer can check the tree involved in the event.
See #2413.
* Make all containers 1fr
An unintended consequence of changes made to containers in v0.21.0 (#2377)
is something like #2385 so this commit sort of rolls that change back, and
solidifies how containers are styled by default in respect to their width
and height. Where appropriate the dimensions will be 1fr.
* Make the DEFAULT_CSS of ProgressBar less greedy
It was attempting to style a Vertical that is uses, but in doing so was
styling all Verticals rather than a Vertical within a ProgressBar.
This fixes that.
* Update the CHANGELOG for the container changes
* Move the ProgressBar CHANGELOG entry into the next release section
* Link the container change entry in the CHANGELOG to its PR
Now that the PR is PRd and we have a PR