Commit Graph

4814 Commits

Author SHA1 Message Date
Dave Pearson
14f83a0a4a Remove commented out code from Button
Some hangover from the work to migrate `disabled` out of `Button` and into
`Widget`, that I forgot to remove.
2023-02-13 15:39:19 +00:00
Dave Pearson
682c4de06d Remove unnecessary comment
Don't use comments as version control! Or, really, I don't need this note to
self any more about the code as it's being handled elsewhere.
2023-02-13 15:11:33 +00:00
Dave Pearson
bbdc70a620 Move the main handling of disabled up to Widget
There's still a bit to do here, but this migrates the main work up to the
`Widget`. At this point `Button` is pretty much built expressed as a
function of what `Widget` provides in terms of things being disabled.

Focus can still move into disabled controls (or in this case right now, into
a disabled `Button`). The next step is to add something that works alongside
`can_focus` to say if a control is currently capable of receiving focus (in
other words, it's `not disabled and can_focus`).
2023-02-13 14:28:10 +00:00
Dave Pearson
1097fb267d Set the initial disabled state later in __init__
I was going too early with setting this; it needs to happen after pretty
much everything else is set up *and* after the super's __init__ has been
called.
2023-02-13 14:25:40 +00:00
Dave Pearson
d37895dfdd Convert some app.update_styles calls into _update_styles calls 2023-02-13 14:23:20 +00:00
Dave Pearson
3707f80aa4 Move duplicate safe calls to update_styles into a single method
It's done as an internal, but can be called from child classes of course.
This is intended to be a single central method of asking the app to update
styles while also not caring if there is no active app available just yet.
2023-02-13 14:19:36 +00:00
Dave Pearson
821a6ff7c1 Simplify the default for disabled on a Widget
There was no need to default to None and then convert to a bool, defaulting
to False is just fine.
2023-02-13 13:09:12 +00:00
Dave Pearson
d3104a92c9 Add disabled as a widget construction keyword argument 2023-02-13 13:05:18 +00:00
Dave Pearson
a0a83e96ad Correct docstring typo 2023-02-13 13:04:01 +00:00
Dave Pearson
257fe7b30a Add enabled and disabled pseudo-classes
Note that this doesn't touch the application of stylesheets yet, in terms of
things like specificity; this just makes sure that the classes exist and can
be seen.
2023-02-13 12:56:52 +00:00
Dave Pearson
7aaf884282 Move disabled out of Button and into Widget
This doesn't go close to what #1748 is intending to do, but moves `disabled`
to where I want it and keeps `Button` working as before.
2023-02-13 12:40:37 +00:00
Dave Pearson
04c207627c Put the placeholder styling background
f495870b08 got a little too carried away.
2023-02-13 10:49:31 +00:00
Dave Pearson
f495870b08 Remove the disabled styling from Input
This seems to be a hangover from the early days of the development of
`Input`, and the styles do nothing as there's nothing else in the `Input`
code that makes use of the class that's involved.

Removed in anticipation of #1748 taking care of this.
2023-02-13 10:12:49 +00:00
Will McGugan
b2b4b27831 Merge pull request #1772 from Textualize/fixes-and-polish
Fixes and polish
2023-02-12 16:12:49 +00:00
Will McGugan
d0a1eb1783 docstring formatting [skip ci] 2023-02-12 16:12:02 +00:00
Will McGugan
6f815a3b39 docstring [skip ci] 2023-02-12 10:22:52 +00:00
Will McGugan
1a5a3e95ca make tests more robust 2023-02-12 10:21:00 +00:00
Will McGugan
7fc475fcdc docstrings 2023-02-12 10:16:05 +00:00
Will McGugan
17d74c2cbc fix typing of css paths 2023-02-12 10:09:18 +00:00
Will McGugan
8e82d110ff docstrings 2023-02-12 10:01:45 +00:00
Dave Pearson
7eab4d3040 Merge pull request #1760 from TomJGooding/feat-keys-add-space-alias-to-displays
feat(keys): add space alias to displays
2023-02-12 09:41:49 +00:00
Will McGugan
83713ee8bb Merge pull request #1771 from Textualize/heisenbug-blog
new blogpost
2023-02-12 09:41:31 +00:00
Will McGugan
933138b3a6 fix link 2023-02-11 20:15:23 +00:00
Will McGugan
a28c970506 Wrong link 2023-02-11 17:41:48 +00:00
Will McGugan
48a4c7cb68 reverse words 2023-02-11 17:25:22 +00:00
Will McGugan
e880f27329 no comma 2023-02-11 17:21:47 +00:00
Will McGugan
93746b75a1 edit 2023-02-11 17:20:08 +00:00
Will McGugan
6004d7c731 typo 2023-02-11 17:16:01 +00:00
Will McGugan
1540f120cc words, non draft 2023-02-11 17:15:35 +00:00
Will McGugan
05042725cd words 2023-02-11 17:11:38 +00:00
Will McGugan
f5723f933e new blogpost 2023-02-11 17:08:21 +00:00
Will McGugan
a37e7fcb2b fix modal example 2023-02-11 15:37:24 +00:00
Will McGugan
27b0f7b9a9 Merge pull request #1765 from Textualize/typing-10-feb
typing fixes
2023-02-10 10:06:24 +00:00
Will McGugan
d15a854d52 typing fixes 2023-02-10 09:59:17 +00:00
Will McGugan
1fd17b5714 Merge pull request #1763 from Textualize/deprecate-text-backend
remove text-backend
2023-02-10 09:21:38 +00:00
Will McGugan
1ca9c5f481 remove text-backend 2023-02-10 09:13:35 +00:00
Dave Pearson
a8218b2ebb Merge pull request #1761 from davep/changelog-add-link
Add missing link for Checkbox->Switch CHANGELOG entry
2023-02-09 21:58:17 +00:00
Dave Pearson
101604bc04 Add missing link for Checkbox->Switch CHANGELOG entry 2023-02-09 21:41:45 +00:00
TomJGooding
a87181dd12 feat(keys): add space alias to displays 2023-02-09 21:22:09 +00:00
Will McGugan
99f1bbd8f4 Update to messaging 2023-02-09 21:19:16 +00:00
Will McGugan
80e74a455f Merge pull request #1759 from Textualize/typing-fix-9-feb-2023
typing fixes
2023-02-09 17:41:59 +00:00
Will McGugan
30912f0430 merge 2023-02-09 17:32:37 +00:00
Will McGugan
4fd7e19e89 lockfile 2023-02-09 17:30:02 +00:00
Will McGugan
b7314d024e Merge pull request #1757 from davep/more-makefile
Add setup and update targets to the Makefile
2023-02-09 17:29:03 +00:00
Will McGugan
f9a5b2a0e8 typing fixes 2023-02-09 17:27:39 +00:00
Will McGugan
0a4067a0f3 Merge pull request #1758 from davep/unhatch
Remove hatch.toml
2023-02-09 17:09:10 +00:00
Will McGugan
42c2bfe277 Merge pull request #1756 from davep/switch-redux
`Switch` redux
2023-02-09 17:08:41 +00:00
Dave Pearson
e8d8c93527 Remove hatch.toml 2023-02-09 16:25:53 +00:00
Dave Pearson
9dc0a4b57d Add setup and update targets to the Makefile
Simply adds `make setup` as a shorthand for running the poetry command that
does the initial install for local development, and also `make update` to do
a package update. Simply aimed as handy extras for development.
2023-02-09 16:18:34 +00:00
Dave Pearson
0b9107abfc Merge branch 'main' into switch-redux 2023-02-09 16:09:56 +00:00