Don't try to focus an unfocusable control; find the first focusable one.
The Edit Colors dialog is not yet keyboard accessible, or very fully
implemented in general, but this at least prevents a scenario where
focus is unexpectedly left in an important dialog window, such as the
"Save changes to X?" prompt, which may also be obscured by Edit Colors.
You don't want pressing Enter to interact with a different dialog than
you're expecting, and suddenly quit without saving.
This reverts commit 42ca86f7eb.
It's needed again after the last commit...
I did override `focus`, so it's not that surprising.
But I definitely want to figure this out.
I'm setting up a virtual environment for the first time, and, trying
to install my dependencies, I ran into errors, 1. because of appscript
which is only intended for Mac, 2. PyGObject which IS for Linux, but
fails to install, missing "libgirepository1.0-dev", but it's optional,
it's just for wallpaper support. pyxgd is also for wallpaper support,
so maybe I should comment it out too.
And finally, [dev] is needed in order to use the `textual` command.
I don't know how well this can install on other systems, but at least
I can install it now, on Ubuntu.
Also, when the version numbers in my requirements.txt were bumped
when regenerating it, I'm guessing now that the dependencies weren't
actually upgraded, since `textual --version` gave me "0.19.1" up until
I set up my virtual environment (.venv), and now it matches the
requirements.txt version of "0.22.3". I still don't know why the version
numbers were bumped, or for sure that they weren't installed at those
versions somewhere in my filesystem. (I hope virtualenv makes things
more comprehensible, rather than more confusing...)
Also, now that I'm using textual 0.22.3, the radio button set has
arrow key navigation. Seeing this feature missing was what prompted me
to set up the virtual environment and (sort of implicitly) upgrade.
However, it doesn't work correctly, for the flipped horiz./vert. layout.
I asked ChatGPT to do this because I'm tired and I was curious if it
could understand. It did it straight away. I didn't even think about
aligning the code like that, it's a good idea.
> Prompt
> Reorder these such that when layed out in a left to right top to bottom grid they're in order top to bottom left to right, with 3 columns:
>
>
> RadioButton(_("100%"), id="value_1"),
> RadioButton(_("200%"), id="value_2"),
> RadioButton(_("400%"), id="value_4"),
> RadioButton(_("600%"), id="value_6"),
> RadioButton(_("800%"), id="value_8"),
> ChatGPT
> Here's the reordered code:
>
> bash
> Copy code
> RadioButton(_("100%"), id="value_1"), RadioButton(_("400%"), id="value_4"), RadioButton(_("800%"), id="value_8"),
> RadioButton(_("200%"), id="value_2"), RadioButton(_("600%"), id="value_6"),
I guess it was for windows with max/min-width/height, which I'm not doing anymore.
That or something else has changed. Yep, covering my bases here.
That, or I'm not covering my bases! You never know.
Or do you knever now?