Commit Graph

1181 Commits

Author SHA1 Message Date
darrenburns
b366d1d49c Pilot - add hover and click methods (#1966)
* Delete redundant test file

* Sketch out pilot API improvements - signatures/docstrings

* Pilot click and hover

* Updating test to use new pilot hover method for DataTable

* hover and click methods for Pilot

* Update changelog

* Add docstring
2023-03-07 15:19:23 +00:00
Dave Pearson
6d23fdf4f1 Ensure the toggle button keeps any bold state (#1965)
* Ensure the toggle button keeps any bold state

Fixes #1963.

* Update snapshots
2023-03-07 15:18:36 +00:00
Dave Pearson
b7de48cca3 Border colour percentage (#1954)
* Allow setting an additional alpha on a border

See #1863.

* Update the ChangeLog

* Add snapshot tests for the border alpha value

* Extend the border snapshot tests

While this doesn't test *every* permutation, it covers enough bases that if
something were to change it should catch it.

* Tweak a typo in the border style examples

* Add border transparency percentage to the border docs

* Add a CSS example for using border transparency

* Add Color.multiply_alpha

* Update the CHANGELOG

* Multiply the alpha on a colour rather than replace it

As requested in
https://github.com/Textualize/textual/pull/1954#pullrequestreview-1328170386

(actually required while talking in person with Will, but noted in the
above)

* Multiply the alpha on a border colour rather than replace it

As requested in
https://github.com/Textualize/textual/pull/1954#pullrequestreview-1328170386

(actually requested while talking in person with Will, but noted in the
above)
2023-03-07 14:14:17 +00:00
darrenburns
fd0e0d9983 Datatable extend background (#1946)
* Extending DataTable widget horizontally

* Fading background of extended DataTable rows

* Updating DataTable snapshots

* Update CHANGELOG.md

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-03-06 16:27:29 +00:00
Dave Pearson
6ba1905d4a Swap the radio button character
See #1934. Simply put: the character that we were using doesn't render well
at all in Windows Terminal on Windows 10 or 11. This one isn't ideal as it
sits a little low, at least in some environments. I want to try this one on
for a wee bit and see how we feel about it.

Honestly, I'm not 100% happy with it; but right now it's the least-worst
option I've tried.
2023-03-06 13:50:28 +00:00
Dave Pearson
f59977563f Merge branch 'main' into windows-friendly-toggle-buttons 2023-03-06 12:42:33 +00:00
Dave Pearson
f7a6981abf Swap the checkbox character to an X
See #1934. Simply put: the character that we were doesn't render well at all
in Windows Terminal on Windows 10; while there are other options available,
few seem to work well there either. So here we go for a bold X; this should
render fine everywhere.
2023-03-06 11:19:29 +00:00
Rodrigo Girão Serrão
51a9eb4a88 Merge branch 'main' into fix-1815 2023-03-06 11:04:31 +00:00
Will McGugan
373fc95fc1 Drop explicit sender attribute from messages (#1940)
* remove sender

* removed priority post

* timer fix

* test fixes

* drop async version of post_message

* extended docs

* fix no app

* Added control properties

* changelog

* changelog

* changelog

* fix for stopping timers

* changelog

* added aliases to radio and checkbox

* Drop sender from Message init

* drop time

* drop cast

* Added aliases
2023-03-06 10:52:34 +00:00
Rodrigo Girão Serrão
b6b76025d0 Add regression test for #1815. 2023-03-02 17:21:19 +00:00
Will McGugan
41003e356c Fix content width (#1910)
* fix calculation for scrollbars

* added snapshot

* fix for name change

* snapshot

* fix for textual colors

* remove logs

* scrollbar logic

* scroll logic

* remove dead code

* snapshot tests

* scrollbar mechanism

* tidy

* demo tweak

* preset window size

* no need for repaint

* Restore repaint

* wait for idle on pause

* colors tweak

* remove wait for idle

* snapshot

* small sleep

* change stabilizer

* debug tweaks

* remove debug

* remove debug

* snapshot test

* docstring

* changelog

* add pause
2023-03-02 14:39:31 +00:00
Dave Pearson
37208b199c Fixes and improvements relating to scrolling
The changes here roll two issues into one change. With this commit:

- Scrolling up/down/etc using the keyboard now moves just one cell, rather
  than moving the number of cells specified by the scroll sensitivity that's
  intended for pointing devices. #1897
- Where appropriate the scrolling is done lazily; that is it is done after
  the next refresh, helping to ensure that the scroll will take into account
  any updates in the same parent call. #1774
2023-02-28 14:59:46 +00:00
Dave Pearson
8c5fb38851 Merge branch 'main' into toggle-boxen 2023-02-27 10:31:06 +00:00
darrenburns
cbe2ab87c6 Datatable labelling rows (#1868)
* Renaming some component classes in DataTable

* Some more renaming of DataTable component classes

* Separate styling for fixed rows/columns from labels

* Highlight fixed rows/cols affected by colour differently

* Tweaking styles for fixed data in DataTable

* Update DataTable snapshots

* Add row label to Row metadata

* Wiring up some labelled row logic behind flags

* Renaming variable in DataTable

* Variable renaming in DataTable

* [no ci] Labelling rows progress

* Add RenderedRow abstraction to DataTable

* Computing label widths

* Use the Column object to represent row label column

* Ability to toggle row labels reactively

* Adjust width calculation for label widths

* Add DataTable.RowLabelSelected

* Posting the RowLabelClick message

* Hovering of row labels applies new style

* Remove a print

* Ensure horizontal scrolling with column cursor accounts for row label column

* Account for possible row labels in cell cursor horizontal scrolling

* Ensure cursor highlighting is correct on row label cells

* Document component class for DataTable label hover

* Test to ensure clicking row label emits correct event

* Add snapshot test for DataTable with fixed rows/cols and row labels

* Using pilot pause instead of wait_for_idle directly

* Update CHANGELOG

* Add a docstring

* Add a note to CHANGELOG.md about RowLabelSelected
2023-02-27 10:29:17 +00:00
Dave Pearson
7bfed019c9 Improve the wording of a test description 2023-02-27 10:08:45 +00:00
Dave Pearson
445e29ff26 Improve the wording of a test description 2023-02-27 10:07:59 +00:00
Dave Pearson
db9b9e1c5d Fix a typo 2023-02-27 10:07:25 +00:00
Dave Pearson
7f90e4e850 Add a test for adding multiple on buttons to a radioset 2023-02-27 10:06:50 +00:00
Dave Pearson
e6e46d0825 Merge branch 'main' into toggle-boxen 2023-02-27 08:53:30 +00:00
Will McGugan
96370b1fd8 Merge pull request #1873 from Textualize/screen-children-fix
fix walk children
2023-02-24 12:36:58 +00:00
Will McGugan
5a77e3493d add test 2023-02-24 10:13:58 +00:00
Dave Pearson
24ce819867 Add snapshot tests for the toggle button examples 2023-02-23 22:05:47 +00:00
Dave Pearson
719c831e3b Add some unit testing for RadioSet 2023-02-23 21:50:14 +00:00
Dave Pearson
d341b8b1b8 Fix a couple of copy/paste-o docstrings 2023-02-23 21:30:06 +00:00
Dave Pearson
236266248d Add CSS class tests for check boxes and radio buttons 2023-02-23 21:10:21 +00:00
Dave Pearson
7c6522e634 Add initial radio button tests 2023-02-23 21:07:39 +00:00
Dave Pearson
cfe7be3abe Some initial Checkbox unit testing
Lots more to come.
2023-02-23 16:46:58 +00:00
Will McGugan
7d99d168ff prevent implementation 2023-02-23 13:49:07 +00:00
Will McGugan
402ef0887d Merge pull request #1860 from Textualize/cache-internals
Cache internals
2023-02-22 16:06:35 +00:00
Will McGugan
07d728382d fix test 2023-02-22 15:59:34 +00:00
Will McGugan
32eb6ee075 test fix 2023-02-22 15:47:28 +00:00
Will McGugan
5686147909 comment 2023-02-22 14:33:23 +00:00
Will McGugan
3c9e89d778 snapshots 2023-02-22 14:21:25 +00:00
Will McGugan
c63cab728b force pause 2023-02-22 14:08:54 +00:00
Will McGugan
edd1c28b79 restore css bases 2023-02-22 13:41:05 +00:00
Will McGugan
801051b70b garantee order 2023-02-22 13:32:49 +00:00
Will McGugan
408342bc0b snapshots 2023-02-22 11:46:50 +00:00
Will McGugan
8152b2af2d snapshot 2023-02-22 09:59:29 +00:00
Will McGugan
d0d50e4981 cache on 3.9 only 2023-02-22 09:49:10 +00:00
Will McGugan
ab3e523aab Merge pull request #1841 from Textualize/reactive-get
Reactive get
2023-02-21 10:43:23 +00:00
Will McGugan
4c9326f66f Merge pull request #1832 from Textualize/batch-update
Batch update
2023-02-21 10:42:31 +00:00
Will McGugan
068d7513b8 Merge pull request #1823 from Textualize/optimize-scroll
Optimize scroll with a Spatial Map
2023-02-21 10:41:04 +00:00
Will McGugan
e4b38f2341 Rename 2023-02-21 09:58:12 +00:00
Will McGugan
453070032e Merge pull request #1785 from davep/promote-disabled
Promote disabled to `Widget` level
2023-02-21 09:56:01 +00:00
Will McGugan
ae498d49c8 Merge branch 'main' into optimize-scroll 2023-02-21 09:40:42 +00:00
Dave Pearson
e666ee7286 Fix variable name typo
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-02-20 21:25:12 +00:00
Dave Pearson
e8e00b1920 Fix variable name typo
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-02-20 21:25:03 +00:00
Dave Pearson
8ec13c3aba Fix variable name typo
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-02-20 21:24:48 +00:00
Dave Pearson
f785a51769 Add combined type CSS parsing tests 2023-02-20 10:08:02 +00:00
Will McGugan
52e522b2e8 test 2023-02-19 22:26:07 +00:00