Commit Graph

3340 Commits

Author SHA1 Message Date
Dave Pearson
3b8b0ebeb2 Remove old test code from design.py
This is covered in unit tests these days.
2022-11-17 11:02:29 +00:00
Dave Pearson
265f770976 Remove old test code from case.py
This is covered in unit tests these days.
2022-11-17 11:01:31 +00:00
Dave Pearson
53b760eea2 Remove old test code from renderables/gradient.py
This isn't currently covered in unit tests but should be at some point?
Either way, having a test in dead code in the library doesn't help much any
more.
2022-11-17 10:58:01 +00:00
darrenburns
37670578ff Ensure cursor visible when no placeholder in Input (#1202)
* Ensure cursor visible when no placeholder in Input

* Update CHANGELOG.md
2022-11-17 10:57:23 +00:00
Dave Pearson
33eefd56cf Remove old test code from renderables/blank.py
This is covered in unit tests these days.
2022-11-17 10:56:27 +00:00
Dave Pearson
f40c0bf3d0 Remove old test code from css/tokenize.py
This is covered in unit tests these days.
2022-11-17 10:53:46 +00:00
Dave Pearson
c8ae2455cf Remove old test code from css/styles.py
This isn't fullt covered in unit tests yet, but the dead code can be removed
and adding unit tests should likely be encouraged.
2022-11-17 10:47:22 +00:00
Dave Pearson
93f952b74b Remove old test code from css/scalar.py
This is covered in unit tests these days.
2022-11-17 10:45:07 +00:00
Dave Pearson
965cc7d19f Remove old test code from css/parse.py
This is covered in unit tests these days.
2022-11-17 10:44:08 +00:00
Dave Pearson
5f4a44c6c6 Fix the devtools example of how to run an app 2022-11-17 10:39:43 +00:00
Dave Pearson
29a891724b Tidy up dead code from linux_driver.py 2022-11-17 10:37:30 +00:00
Dave Pearson
8a6d21da5e Add the basics of Label docs for the manual 2022-11-17 10:15:35 +00:00
Dave Pearson
67386478ef Trailing whitespace squishing 2022-11-17 10:14:55 +00:00
Dave Pearson
6744404e07 Merge branch 'Textualize:main' into label-widget 2022-11-17 08:43:18 +00:00
darrenburns
e0ddea839d Update changelog regarding horizontal width auto fix (#1192)
Co-authored-by: Dave Pearson <davep@davep.org>
2022-11-16 21:48:30 +00:00
Dave Pearson
a1ed58a682 Merge branch 'main' into label-widget 2022-11-16 20:46:48 +00:00
Will McGugan
fd61ca69a4 Update comment.yml 2022-11-16 17:02:50 +00:00
Will McGugan
572d9b6968 Merge pull request #1195 from davep/button-variant-check
Check button variant for validity during button construction
2022-11-16 16:58:09 +00:00
darrenburns
e32e094b92 Support callables in App.SCREENS (#1185)
* Support Type[Screen] in App.SCREENS (lazy screens)

* Update CHANGELOG

* Remove redundant isinstance
2022-11-16 15:47:48 +00:00
Dave Pearson
e3899c0c10 Check button variant for validity during button construction
See #1189
2022-11-16 15:41:48 +00:00
darrenburns
df37a9b90a Add get_child_by_id and get_widget_by_id (#1146)
* 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
2022-11-16 15:29:59 +00:00
Will McGugan
3d35a602b5 added node expanding 2022-11-16 15:15:42 +00:00
Dave Pearson
22863148ef Update src/textual/widgets/_label.py
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2022-11-16 15:09:27 +00:00
Dave Pearson
c881a9657f Add a Label widget
For the moment this does nothing more than inherit from a Static; but what
it does do is make it easier for someone to add text to their application
and to style it by styling all the Labels. Before now it would be common to
use a Static but if you try and style (or query) all Statics, you'd also get
things like Buttons, which inherit from Static.

See #1190
2022-11-16 15:03:24 +00:00
darrenburns
a465f5c236 Horizontal width auto (#1155)
* 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
2022-11-16 14:49:52 +00:00
Will McGugan
22f37871d9 node selected 2022-11-16 14:44:04 +00:00
Dave Pearson
a37eac3cad Merge pull request #1187 from davep/docstring-tidy 2022-11-15 17:43:09 +00:00
Dave Pearson
8c6c68a479 Add a docstring for the bind method 2022-11-15 16:49:13 +00:00
Dave Pearson
94e02b8d24 Add types to the docstrings for a Binding 2022-11-15 16:43:55 +00:00
Dave Pearson
38e6d1dbcb Update the docstring of get_box_model
It looks like the get_auto_* parameters got renamed at some point so this
seeks to update the docstring for that. I'm not 100% sure if the description
of the parameters fully holds so that'll need checking.
2022-11-15 16:40:13 +00:00
Will McGugan
514a3c9f90 remove debug 2022-11-15 15:53:23 +00:00
Will McGugan
5c873a0d44 tweak guide depth defaults 2022-11-15 15:35:12 +00:00
Will McGugan
b15cdc61ac added guide depth 2022-11-15 15:33:28 +00:00
Will McGugan
aab0dbfc4a Added cache and lru grow method 2022-11-15 15:06:02 +00:00
Will McGugan
9fd1e7605a Create PULL_REQUEST_TEMPLATE.md 2022-11-15 14:58:38 +00:00
Will McGugan
eb31d90f69 Merge pull request #1182 from davep/border-scream-test
Cleanup of _border.py
2022-11-15 13:47:08 +00:00
Will McGugan
e79cad6cb5 Merge pull request #1173 from davep/move-child
Add Widget.move_child
2022-11-15 13:46:22 +00:00
Will McGugan
a6f4a05776 Merge pull request #1168 from Textualize/test-deadlock
fix deadlock on tests
2022-11-15 13:46:03 +00:00
Dave Pearson
2ac0b60fed Merge pull request #1181 from davep/bug/1175/missing-borders
Don't take transparent to imply not visible
2022-11-15 13:32:59 +00:00
Will McGugan
650b654966 remove nesting of try 2022-11-15 13:28:18 +00:00
Will McGugan
e84f9b1273 ws 2022-11-15 13:23:29 +00:00
Dave Pearson
7213834bd4 Update the CHANGELOG 2022-11-15 13:07:50 +00:00
Dave Pearson
8e89561e2d Cleanup of _border.py
All indications are that Border isn't used within Textual any more.
2022-11-15 13:03:06 +00:00
Will McGugan
758b9a735c Merge pull request #1178 from davep/styles-cache-typo
Correct a typo in the StylesCache docstring
2022-11-15 12:07:02 +00:00
Will McGugan
551a7bb7f0 fix for styling issues 2022-11-15 12:05:57 +00:00
Dave Pearson
af1168b4ee Don't take transparent to imply not visible
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.
2022-11-15 11:59:01 +00:00
Dave Pearson
912980d615 Correct a typo in the StylesCache docstring 2022-11-15 09:56:48 +00:00
Will McGugan
4473bc6ce6 added partial rich style 2022-11-14 18:26:44 +00:00
Will McGugan
32ea8eb1ef focus and scroll 2022-11-14 18:13:23 +00:00
Dave Pearson
54bf7a9fd3 Add a docstring note about before/after being mutually exclusive 2022-11-14 16:56:37 +00:00