Commit Graph

4832 Commits

Author SHA1 Message Date
Darren Burns
43c2696ccf Small rename in DataTable utility types 2023-02-01 15:25:13 +00:00
Will McGugan
9e5814ed0f Strip improvements and line api 2023-02-01 16:22:14 +01:00
Rodrigo Girão Serrão
faa2ee68d7 Merge pull request #1706 from Textualize/document-sub-title
Document setting (sub) title in the app guide
2023-02-01 15:08:43 +00:00
Dave Pearson
d350374e59 Revert Tree.clear and add Tree.reset
After some internal discussion we've decided to keep `Tree.clear` as it was,
and add a `Tree.reset`, which does a `Tree.clear` but resets the label and
data of `Tree.root` to the values given, while mirroring how `Tree.__init__`
takes those parameters.
2023-02-01 15:08:03 +00:00
Darren Burns
c84ae53395 Fix docstring indentation to fix mkdocs rendering 2023-02-01 15:07:38 +00:00
Darren Burns
79b08aa6b5 Merge branch 'main' of github.com:Textualize/textual into datatable-cell-keys 2023-02-01 14:55:14 +00:00
Darren Burns
3f463cb0ef Store strings as strings 2023-02-01 14:54:33 +00:00
Rodrigo Girão Serrão
2140aa52d2 Update docs/guide/app.md 2023-02-01 14:53:20 +00:00
Darren Burns
a7383e6a83 Import and export datatable utilities from public module 2023-02-01 14:51:05 +00:00
Darren Burns
67d79e16da Simplify _get_offsets to return header row key 2023-02-01 14:10:01 +00:00
Darren Burns
53685ee2b5 Docstring update in DataTable 2023-02-01 13:59:44 +00:00
Darren Burns
c9629b1755 Ensure keys are included in emitted events from DataTable 2023-02-01 13:53:48 +00:00
Dave Pearson
8b4a833e26 Update the CHANGELOG 2023-02-01 13:47:48 +00:00
Dave Pearson
78f49f0ab2 Allow replacement of the root node data when clearing the tree 2023-02-01 13:44:53 +00:00
Dave Pearson
ff7f2488f8 Remove Tree class name clash with how pytest works
Just before doing the commit I decided to rename the test tree in the new
unit test for clearing down a tree. Of course I managed to name it in such a
way that it becomes special to pytest.

This fixes that.
2023-02-01 12:45:18 +00:00
Dave Pearson
7563d4cb7e Allow setting a new label when performing a clear on a Tree
See #1437 for background. While it would be ideal to allow for the complete
emptying of a Tree, the root node is required (and it's part of the
construction of a Tree). So, here, when clearing the Tree we optionally
allow for a new label to be given.

Ideally we'll also allow for fresh data to be provided too; but there's a
wrinkle there in knowing the difference between the data being None, and no
data being provided (so the current root's data being carried over).
Following the method of defaulting used in __init__ would cause problems. As
such, rather than roll all of this into one commit, this goes with the basic
requirement and the solution for data will follow.

Note this also starts some unit tests for the clearing of a Tree.
2023-02-01 12:33:36 +00:00
Will McGugan
8ddd52962b Merge pull request #1708 from davidbrochart/docs
Fix typo
2023-02-01 12:40:17 +01:00
Darren Burns
bf42ac94f7 Ensure row_key is included in RowHighlighted event 2023-02-01 11:34:39 +00:00
Rodrigo Girão Serrão
476eca7a6e Shuffle sections around. 2023-02-01 11:30:56 +00:00
David Brochart
d1790caff7 Fix typo 2023-02-01 12:25:00 +01:00
Darren Burns
cc3d744168 Add row_key to RowHighlighted event in DataTable 2023-02-01 11:15:31 +00:00
Darren Burns
07e964d2ba More docstrings for the DataTable, new private property refactor for total_row_height 2023-02-01 11:14:08 +00:00
Rodrigo Girão Serrão
521e90488c Add context about (sub)title. 2023-02-01 11:08:13 +00:00
Darren Burns
655b2b3ea7 Docstring updates 2023-02-01 10:57:03 +00:00
Rodrigo Girão Serrão
828d8d2cf1 Replace Static with Label. 2023-01-31 17:31:36 +00:00
Rodrigo Girão Serrão
c14f635244 Document setting app (sub)title. 2023-01-31 17:31:06 +00:00
Darren Burns
0b2b7a9646 Docstring improvements 2023-01-31 16:43:33 +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
Dave Pearson
f2e756b695 Update the CHANGELOG 2023-01-31 15:54:27 +00:00
Dave Pearson
6e1f18910a Keep a visible, but darker, cursor in Tree when it doesn't have focus
See #1471. It seems useful and important for a Tree to still have a cursor
visible even when it doesn't have focus -- that ways someone can build a UI
where the user can tab away from the tree to something that relates to the
node, and still see which node is in play.
2023-01-31 15:51:31 +00:00
Darren Burns
25abe4dbdf Expose ordered rows and ordered columns publically 2023-01-31 15:30:23 +00:00
Darren Burns
f97cdd6797 Remove redundant attribute. Add more DataTable docstrings. 2023-01-31 15:18:33 +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
Rodrigo Girão Serrão
c79f19c1c7 Rename attribute. 2023-01-31 15:07:30 +00:00
Dave Pearson
4143bd7ee5 Merge pull request #1701 from davep/CHANGELOG-tweak
Fix wording of entry in CHANGELOG to match lines around it
2023-01-31 14:48:17 +00:00
Dave Pearson
1cc5b3799c Fix wording of entry in CHANGELOG to match lines around it 2023-01-31 14:45:28 +00:00
Dave Pearson
ff76157479 Merge pull request #1700 from davep/tree-select-expand-divorce
Enhance `Tree` so that there is a expand/collapse action that is separate from select
2023-01-31 14:33:43 +00:00
Will McGugan
fc22576691 Merge pull request #1699 from Textualize/auto-width-inputs
Auto width inputs
2023-01-31 14:46:03 +01:00
Darren Burns
e02ef1e22c Update watcher/validator names in DataTable 2023-01-31 13:42:53 +00:00
Darren Burns
0ad26c3361 Merge branch 'main' of github.com:Textualize/textual into datatable-cell-keys 2023-01-31 13:37:41 +00:00
Darren Burns
abd35436fb Some refactoring, and add cell_key to DataTable.CellSelected 2023-01-31 13:34:13 +00:00
Dave Pearson
6db5217f3e Modify Tree message unit tests to take new action in to account
See #1433.
2023-01-31 13:32:46 +00:00
Darren Burns
48488e7402 Add cell_key to CellHighlighted event 2023-01-31 13:29:18 +00:00
Dave Pearson
2086b713db Update the CHANGELOG 2023-01-31 13:17:58 +00:00
Dave Pearson
606af8d3a2 Correct a typo in the docstring of action_scroll_end 2023-01-31 13:12:03 +00:00
Darren Burns
8f928f4b76 Import optimising 2023-01-31 13:05:02 +00:00
Darren Burns
206ad761d1 Merge branch 'datatable-cell-keys' of github.com:Textualize/textual into datatable-cell-keys 2023-01-31 13:03:51 +00:00
Darren Burns
95b52eef0d Refresh column widths on idle 2023-01-31 13:03:36 +00:00
Dave Pearson
9e406f525e Add a docstring to action_scroll_end 2023-01-31 13:03:23 +00:00