Commit Graph

269 Commits

Author SHA1 Message Date
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
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
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
24ce819867 Add snapshot tests for the toggle button examples 2023-02-23 22:05:47 +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
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
4c9326f66f Merge pull request #1832 from Textualize/batch-update
Batch update
2023-02-21 10:42:31 +00:00
Will McGugan
433e371dc9 changelog and snapshots 2023-02-19 10:05:37 +00:00
Dave Pearson
d90cae3a92 Add Markdown and MarkdownViewer to the disabled snapshot test 2023-02-15 11:26:58 +00:00
Dave Pearson
2379bb46e0 Add type annotation to the DataTable
Now that the new DataTable is merged in.
2023-02-15 11:22:58 +00:00
Dave Pearson
4fe1e0f0c5 Merge branch 'main' into promote-disabled 2023-02-15 11:10:45 +00:00
Darren Burns
495afce0f7 Update column cursor snapshot 2023-02-15 10:43:48 +00:00
Dave Pearson
6ab9a424a2 Merge branch 'main' into promote-disabled 2023-02-15 10:14:21 +00:00
Will McGugan
0dac83668b Merge pull request #1791 from Textualize/textual-markdown
Textual markdown
2023-02-15 09:23:19 +00:00
Dave Pearson
ba9b2e03d9 Merge branch 'main' into promote-disabled 2023-02-15 08:47:20 +00:00
Dave Pearson
8ebb70efac Refresh the snapshots 2023-02-14 16:22:15 +00:00
Dave Pearson
26df6aeb00 Tidy up the disabled snapshot test 2023-02-14 16:20:52 +00:00
Dave Pearson
b4f8a6b778 Add disabled snapshot test to the general snapshot tests 2023-02-14 15:53:45 +00:00
Dave Pearson
fbd871c3d7 Start a snapshot test for disabled widgets
Eventually this should likely have every user-interactive widget within it.
Perhaps every widget.
2023-02-14 15:52:52 +00:00
Will McGugan
a94c725a3b tests and changelog 2023-02-14 15:26:27 +00:00
Darren Burns
df1116d776 Post an event when DataTable column header clicked 2023-02-14 15:01:02 +00:00
Dave Pearson
3c8f464818 Update the snapshots
The disabled styling has changed slightly, and there is a snapshot test for
buttons which is now thrown off. This updates that.
2023-02-14 11:44:36 +00:00
Darren Burns
f4cd51e5e8 Merge branch 'main' of github.com:Textualize/textual into datatable-cell-keys 2023-02-09 15:55:45 +00:00
Dave Pearson
c436b57ed5 Merge branch 'main' into checkbox-switch 2023-02-09 13:57:15 +00:00
Will McGugan
f450d98e3e snapshot 2023-02-09 11:55:36 +00:00
Will McGugan
3a9c052d20 Added snapshot 2023-02-09 11:49:11 +00:00
Dave Pearson
decc1e2f3c Rename Checkbox to Switch
A new form of Checkbox will be arriving in Textual soon, working in
conjunction with a RadioButton. What was called Checkbox is perhaps a wee
bit heavyweight in terms of visual design, but is a style of widget that
should remain.

With this in mind we're renaming the current Checkbox to Switch. In all
other respects its workings remains the same, only the name has changed.

Things for people to watch out for:

- Imports will need to be updated.
- Queries will need to be updated; special attention will need to be paid to
  any queries that are string-based.
- CSS will need to be changed if any Checkbox styling is happening, or if
  any Checkbox component styles are being used.

See #1725 as the initial motivation and #1746 as the issue for this
particular change.
2023-02-09 11:10:30 +00:00
Darren Burns
0721d7fc87 Snapshot test for sorting 2023-02-08 10:39:04 +00:00
Darren Burns
dca164d70f Update snapshots for datatable_render test 2023-02-08 09:54:33 +00:00
Darren Burns
6de6ed769e Merge branch 'main' of github.com:Textualize/textual into datatable-cell-keys 2023-02-07 13:40:51 +00:00
Will McGugan
5930ebf82e remove _typing.py 2023-02-07 10:46:28 +00:00
Darren Burns
c9ccbce41b Merge branch 'main' of github.com:willmcgugan/textual into datatable-cell-keys 2023-02-06 12:46:07 +00:00
Dave Pearson
6f24331564 Merge pull request #1703 from davep/lowkey-tree-selection
Lowkey tree selection
2023-01-31 16:27:15 +00:00
Dave Pearson
b0a29050cf Update snapshots after change of unfocused tree cursor handling 2023-01-31 16:20:41 +00:00
Rodrigo Girão Serrão
40fde8cfb9 Merge pull request #1610 from Textualize/fix-1607
Fix #1607 to allow programmatic style changes
2023-01-31 15:13:24 +00:00
Will McGugan
e446695684 snapshot fix 2023-01-31 12:53:32 +01:00
Will McGugan
330db5fc80 snapshot 2023-01-31 12:43:07 +01:00
Will McGugan
be5a67e903 fix auto width glitch 2023-01-31 12:13:25 +01:00
Will McGugan
71a0a6676f docstring [skip ci] 2023-01-30 19:02:35 +01:00
Will McGugan
4aa988347f add tests 2023-01-30 18:59:23 +01:00
Darren Burns
61bf8c8a5a Merge branch 'main' of github.com:willmcgugan/textual into datatable-cell-keys 2023-01-30 15:51:51 +00:00
Will McGugan
88b155132b Merge branch 'main' into scroll-sensitivity 2023-01-30 15:59:49 +01:00