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

Popup's can't have transparent background anymore. #86580

Closed
azagaya opened this issue Dec 28, 2023 · 9 comments
Closed

Popup's can't have transparent background anymore. #86580

azagaya opened this issue Dec 28, 2023 · 9 comments
Labels

Comments

@azagaya
Copy link
Contributor

azagaya commented Dec 28, 2023

Tested versions

Reproducible in 4.2.stable

System information

Windows 11 and Ubuntu 23.04 Godot 4.2 stable, Vulkan Forward +

Issue description

When using a stylebox (either texture, empty or flat) that does not cover the entire rect, the back of the popup will use the clear color instead of being transparent, which causes unpleasant results. This was working ok in 3.x.

This image is an example of an option button, whose popup panel has a style of a rounded flat box.

image

Steps to reproduce

1- Create option button
2- Add a StyleBoxFlat to the "panel" in the PopupMenu theme.
3- Round the corners of that StyleBox
4- Add items to the option button
5- Run the game and test the option button

Minimal reproduction project (MRP)

ThemeIssues.zip

@AThousandShips
Copy link
Member

AThousandShips commented Dec 28, 2023

Have you set transparent and transparent_bg true on the Popup?

@azagaya
Copy link
Contributor Author

azagaya commented Dec 28, 2023

@AThousandShips hey, no i haven't. How do i set transparent to true in the popup of an optionbutton?

@AThousandShips
Copy link
Member

You get the popup with get_popup

@azagaya
Copy link
Contributor Author

azagaya commented Dec 28, 2023

@AThousandShips so if i want to use a theme that has a style like this, i need to also add a script that does this? I only want to have themes and be able to change them.

@azagaya
Copy link
Contributor Author

azagaya commented Dec 28, 2023

Adding a script that sets transparent_bg to the popup returned by get_popup works. However this is a bit unusable for theming, as you would have to do this on everything that has a popup.

@AThousandShips
Copy link
Member

(please don't tag me, it's just us here, I don't need the additional notifications)

This is a limitation, transparent backgrounds are expensive and it's not possible to just detect this easily, so it's something you need to do manually

If you want to change this you need to open a proposal as this isn't a bug, assuming it works with the correct fix

@azagaya
Copy link
Contributor Author

azagaya commented Dec 28, 2023

Ok, sorry for the tag. I'll look into writing a proposal.

@AThousandShips
Copy link
Member

Closing as per the above 🙂

@kleonc
Copy link
Member

kleonc commented Dec 28, 2023

@azagaya See #76071, #81669 (comment). For a potential workaround idea see #76071 (comment) (you'd need to tweak it to your needs).

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

No branches or pull requests

3 participants