Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding SpinBoxUI to the UI module #499

Merged
merged 62 commits into from Aug 10, 2023
Merged

Conversation

ganimtron-10
Copy link
Contributor

Creating a SpinBoxUI with tutorials and tests.
Fury-SpinBoxUI

@pep8speaks
Copy link

pep8speaks commented Sep 14, 2021

Hello @ganimtron-10! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-08-19 16:40:36 UTC

@codecov
Copy link

codecov bot commented Sep 14, 2021

Codecov Report

Merging #499 (315a7ba) into master (9a9cf7f) will increase coverage by 0.16%.
Report is 15 commits behind head on master.
The diff coverage is 98.80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #499      +/-   ##
==========================================
+ Coverage   84.32%   84.49%   +0.16%     
==========================================
  Files          44       44              
  Lines       10370    10454      +84     
  Branches     1407     1411       +4     
==========================================
+ Hits         8745     8833      +88     
+ Misses       1255     1252       -3     
+ Partials      370      369       -1     
Files Changed Coverage Δ
fury/ui/elements.py 90.20% <98.80%> (+0.41%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ganimtron-10,

Thank you for doing this! Overall, it looks good to me. I need to play a bit with these new UI elements because I am not sure that is draggable. if not, I recommend you add an option for this.

The logic for set_value is strange to me. If I do set_value(10) I would expect my value to be 10 and not in/decremented by 10. value should be a property where you can set whatever you want. increment(self) and decrement(self) function should be added and used in your de/increment_callback

@ganimtron-10
Copy link
Contributor Author

Hi @skoudoro !
Thanks for the review.

The logic for set_value is strange to me. If I do set_value(10) I would expect my value to be 10 and not in/decremented by 10. value should be a property where you can set whatever you want. increment(self) and decrement(self) function should be added and used in your de/increment_callback

For this, At first I too used the same approach of creating two different functions but both the functions were replication of each other just differing at in/decrement so I created a single function, but I should have given it more descriptive name!

I will update the code according to the comments! ASAP.
Thanks!

@ganimtron-10
Copy link
Contributor Author

I have updated the callbacks and made value as a property. PTAL. Thanks!

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ganimtron-10,

See below for some comments to improve this UI. it is close to being merged.

  • When you change the SpinBox size, there are many alignment issues.
  • When I min_val=10 and we reach it, the cone is still rotating. is it normal? same with max_val
  • TextBox2D is editable. when we edit it on the scene, it would be good to catch this event and rotate the cone.

Thanks for the future update!

docs/tutorials/02_ui/viz_spinbox.py Outdated Show resolved Hide resolved
docs/tutorials/02_ui/viz_spinbox.py Outdated Show resolved Hide resolved
docs/tutorials/02_ui/viz_spinbox.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Show resolved Hide resolved
fury/ui/elements.py Show resolved Hide resolved
fury/ui/elements.py Show resolved Hide resolved
@ganimtron-10
Copy link
Contributor Author

Hi @skoudoro ,
I have updated the code according to comments and also created a new PR for catching the textbox editing complete event.
PTAL.
Thanks!

@ganimtron-10
Copy link
Contributor Author

Hey @skoudoro ,
Let me know if there are any updates on this PR.
Thanks!

@ganimtron-10
Copy link
Contributor Author

Hey @skoudoro ,
Are there any works still pending on the PR??

@ganimtron-10
Copy link
Contributor Author

Hello @skoudoro,
I have rebased this PR with the current changes. PTAL.

@ganimtron-10
Copy link
Contributor Author

I have updated this branch!
This will be ready to go once #790 is merged!

@skoudoro
Copy link
Contributor

skoudoro commented Jun 6, 2023

Thank you @ganimtron-10.

I will be able to look at #790 later this week. From next week, the review rhythm will accelerate and be faster

@skoudoro
Copy link
Contributor

skoudoro commented Aug 2, 2023

What is the update on this PR @ganimtron-10 ? Since, Textblock is fixed and merged, this PR should done, finalized and merged this week, right ?

@ganimtron-10
Copy link
Contributor Author

This would be ready once we merge #830, it helps to easily implement the modification done to the TextBlock2D.

@ganimtron-10 ganimtron-10 mentioned this pull request Aug 2, 2023
@ganimtron-10
Copy link
Contributor Author

Hey @skoudoro,
This PR is ready for review!
Most of the tests have passed and some are still in progress which would also get done.

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ganimtron-10,

See below my comments. it needs some update. Please, let me know when it is done

fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Outdated Show resolved Hide resolved
fury/ui/elements.py Show resolved Hide resolved
@ganimtron-10
Copy link
Contributor Author

Hey @skoudoro , I have updated the validating part for the textbox input and the tests completed successfully.

Regarding the text touching the borders, I checked the positions for both the text actor and the background, and they are at the same position.
I am not sure how we should proceed with this, but an approach that comes to my mind is

  • to move the background a bit up so the text aligns with the background
  • or maybe add a new parameter called padding which defines the padding around the text so that the background is always bigger than the text actor.

I checked other elements too and this issue is not specific to SpinBoxUI, it is a general issue with the TextBlock2D and TextBox2D which was visible because of the larger size of the SpinBoxUI. Maybe we need to handle this separately to keep this PR contained to the specified scope.

@skoudoro
Copy link
Contributor

I have updated the validating part for the textbox input and the tests completed successfully.

Thank you for the update. I will look into it in a 1h

I checked other elements too and this issue is not specific to SpinBoxUI, it is a general issue with the TextBlock2D and TextBox2D which was visible because of the larger size of the SpinBoxUI. Maybe we need to handle this separately to keep this PR contained to the specified scope.

Ok, I see, can you start a PR to fix that. Let's try to fix this issue this week. we can do a pair coding session on Friday to finalize what you will start today.

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ganimtron-10,

All good! Just missing one thing:

can you add your example inside the ui section of _valid_examples.toml

Then we can merge the PR and create a new PR concerning issue with the TextBlock2D and TextBox2D

@ganimtron-10
Copy link
Contributor Author

Hey @skoudoro ,
I updated the example in the valid_example file!

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM! merging

@skoudoro skoudoro merged commit 83f16ef into fury-gl:master Aug 10, 2023
18 of 28 checks passed
@skoudoro
Copy link
Contributor

Now, let's look at the issue with the TextBlock2D and TextBox2D !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants