-
Notifications
You must be signed in to change notification settings - Fork 55
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
Added option to hide Container #81
Conversation
Good morning! I love the idea of hiding elements but I think the property
belongs on the widget object not the container. That way we can set any
widget to hidden.
So you could call
container.GetWidget().Hidden = true
or
button.GetWidget().Hidden = true
…On Wed, Jul 5, 2023, 10:29 AM CLAassistant ***@***.***> wrote:
[image: CLA assistant check]
<https://cla-assistant.io/ebitenui/ebitenui?pullRequest=81>
Thank you for your submission! We really appreciate it. Like many open
source projects, we ask that you sign our Contributor License Agreement
<https://cla-assistant.io/ebitenui/ebitenui?pullRequest=81> before we can
accept your contribution.
You have signed the CLA already but the status is still pending? Let us
recheck <https://cla-assistant.io/check/ebitenui/ebitenui?pullRequest=81>
it.
—
Reply to this email directly, view it on GitHub
<#81 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJ7PVTC6L7JJIPLEHMIJ2TXOV237ANCNFSM6AAAAAAZ7BMIS4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks @mcarpenter622 I knew I wasn't on the right track. I added the attribute to Widget and adapted the layout render to ignore widgets that are in Hidden state. This still needs to be tested with all layout types, but wanted to get your thoughts on code. |
Other than some misspellings in your comments, that looks good to me! I'll
have to test it later to confirm but thank you for the awesome work!
…On Wed, Jul 5, 2023, 1:12 PM Samuel ***@***.***> wrote:
Thanks @mcarpenter622 <https://github.com/mcarpenter622> I knew I wasn't
on the right track.
I added the attribute to Widget and adapted the layout render to ignore
widgets that are in Hidden state.
This still needs to be tested with all layout types, but wanted to get
your thoughts on code.
—
Reply to this email directly, view it on GitHub
<#81 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJ7PVWDC5WADPHDPKBCTPLXOWN75ANCNFSM6AAAAAAZ7BMIS4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
So I've been playing around a bit and I think there's a corner case I'd like your thoughts on: Do hidden elements take up space? cc @mcarpenter622 Here the Row Layout takes up space, but the buttons do not. Here the Row Layout doesn't take up space (buttons stay the same). In my case I want the row to take up space as it stops the row below from jumping up and down, but I don't want the buttons to do so. It kinda makes sense to not have Hidden options take up space, which would mean I need to work around the jumping up and down in my project, which I think I can do with an empty container. |
Alternatively we could add something like |
How about an enum for Visibility?:
Visibiilty_Show
Visibility_Hide //hidden but takes up space
Visibility_None //hidden and doesn't take up space
…On Thu, Jul 6, 2023, 4:09 AM Samuel ***@***.***> wrote:
Alternatively we could add something like HiddenBehaviour with NonBlocking
and Blocking
—
Reply to this email directly, view it on GitHub
<#81 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJ7PVXIKF2M43KXVZRZMRLXOZXCZANCNFSM6AAAAAAZ7BMIS4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Great idea. I'll code it in and do some testing. |
I added an example to play with. There's still odd behavior with I'm not sure about the names also:
When I was using it the difference between |
@kidk Sorry for taking so long to respond, been dealing with some stuff with work. I am ok with the suggested names. I havent had a chance to check out the Row Layout issue yet. |
No worries @mcarpenter622 There's no urgency from my side at all, so whenever you have time. 👍 I'll make the suggested changes soon. |
So I've been testing this tonight and from what I can tell the RowLayout is working as expected. The issue with the blue box in your PR is that it is in a gridLayout. GridLayouts have a column and stretch setting, It doesn't care about what children are in each cell. I changed middleContainer to a RowLayout and added a 3rd element. When I "None" or "Hide' the blue box, the new child behaves as I would expect. All in all this looks like a great change. My only requests are 1) Update the enum names if you'd like, and add a section in the launch.json file for visibility (alphabetized) Otherwise I am happy to merge this! |
Hey @kidk I really like this PR! Just checking to see if you're still willing to update it? If not I'll make the few changes I mentioned a couple weeks ago and merge it =) |
I should have some time this weekend to get it into final state. Work has been getting in the way 😄 |
Trust me I get that! I just appreciate the assistance
…On Thu, Aug 24, 2023, 9:04 AM Samuel ***@***.***> wrote:
I should have some time this weekend to get it into final state. Work has
been getting in the way 😄
—
Reply to this email directly, view it on GitHub
<#81 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJ7PVRRQ4EVGWFZUE3ZXR3XW5GM3ANCNFSM6AAAAAAZ7BMIS4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@mcarpenter622 I've updated the constants and example. I think it's good for final review |
Thank you for the great PR! Sorry it took me so long to review it. I didnt get an alert when you commented for some reason =(. |
I needed a way to hide containers but I couldn't figure out a way to do so.
I plan to update the docs and add an example, but could you check if you like the way it was programmed before I do that.
Thanks a lot!
Example usage