Port ListBox2D and ListBoxItem2D to v2 #1111 architecture#1131
Port ListBox2D and ListBoxItem2D to v2 #1111 architecture#1131AdityaGupta716 wants to merge 16 commits intofury-gl:v2from
Conversation
|
@maharshi-gor @ganimtron-10 plz review |
ganimtron-10
left a comment
There was a problem hiding this comment.
Hi @AdityaGupta716 , Thanks for the PR.
The changes should be done into the exisiting format and structure. Please refer review comments and Panel2D PR.
Also make sure all the existing features and test are present as it is and please add a demo file so its easier to test the UI element.
Thanks!
|
Hi @ganimtron-10, addressed all review comments — moved both classes and tests into containers.py and test_containers.py, deleted the separate files, and added a demo at docs/examples/viz_listbox.py along with registering it in _valid_examples.toml. PTAL. |
ganimtron-10
left a comment
There was a problem hiding this comment.
Hi @AdityaGupta716 ,
I started reviewing but executing the demo file gave me this blank grey box so stopped moving further.
Please fix it and let me know will continue. PTAL few comments mentioned.
fury/ui/tests/test_containers.py
Outdated
| # npt.assert_equal(5, next(collapses)) | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("ignore::RuntimeWarning") |
There was a problem hiding this comment.
We should not ignore RuntimeWarning
fury/ui/tests/test_containers.py
Outdated
| assert lb.selected == [] | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("ignore::RuntimeWarning") |
fury/ui/tests/test_containers.py
Outdated
| assert lb.selected == ["a"] | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("ignore::RuntimeWarning") |
fury/ui/tests/test_containers.py
Outdated
| assert set(lb.selected) == {"a", "b"} | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("ignore::RuntimeWarning") |
fury/ui/tests/test_containers.py
Outdated
| assert lb.selected == ["a", "b", "c"] | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("ignore::RuntimeWarning") |
|
@ganimtron-10 Hi done with the changes |

Closes #1111
Summary
Ports
ListBox2DandListBoxItem2Dfrom the legacy branch to the v2 architecture, following the same patterns used by existing v2 components likePanel2D.Changes
ListBox2DandListBoxItem2Dnow properly inherit fromUIand implement all required abstract methods (_setup,_get_actors,_add_to_scene,_get_size,_set_position,_update_actors_position)Panel2D,Rectangle2D,TextBlock2D(self, event)ListBox2DandListBoxItem2Dinfury/ui/__init__.pyiand__init__.pyfollowing the lazy loader patternBug Fix
Panel2D._get_actorsand_update_actors_positioncrashing withAttributeError: 'Panel2D' object has no attribute 'borders'whenhas_border=FalseKnown Limitations
WheelEventis not yet integrated into the v2 UI event system. A TODO comment has been left for when this is supported.Tests