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

Vertical scrollbar is visible in all popup menus when using a custom display scale #89482

Closed
passivestar opened this issue Mar 14, 2024 · 9 comments · Fixed by #86553 or #91114
Closed

Comments

@passivestar
Copy link
Contributor

passivestar commented Mar 14, 2024

Tested versions

v4.3.dev.custom_build [da945ce]

Wasn't happening in 4.2.1

System information

Godot v4.3.dev (da945ce) - macOS 14.2.1 - Vulkan (Forward+) - integrated Apple M1 Max - Apple M1 Max (10 Threads)

Issue description

It's like this in every popup menu:

image

EDIT: Correction, this has nothing to do with a theme, this is with no theme:

image

Steps to reproduce

Use this theme with 4.3

This might be mac-specific because I asked another person and found out that it's not happening on windows

Open 4.3 and set custom display scale to 1.6

Minimal reproduction project (MRP)

N/A

@AThousandShips

This comment was marked as outdated.

@AThousandShips AThousandShips added this to the 4.3 milestone Mar 14, 2024
@passivestar passivestar changed the title Vertical scrollbar is visible in all popup menus when using a custom theme Vertical scrollbar is visible in all popup menus when using a custom display scale Mar 14, 2024
@passivestar
Copy link
Contributor Author

Can you test if it's fixed by:
#89462

alas, not fixed by that PR

@kitbdev
Copy link
Contributor

kitbdev commented Mar 15, 2024

It might be caused by the content margins on the scroll container's theme.

@Koyper
Copy link
Contributor

Koyper commented Apr 13, 2024

#86553 will also fix this issue, as I noticed and fixed it there. It was caused by the changes in #87462 per the comment above. At fractional content scales greater than 1.0, truncation of the menu content height during the minimum size calculation can leave the total control menu height slightly shorter than the content, which causes the scroll container to show the vertical scrollbar.

@akien-mga
Copy link
Member

Fixed by #86553.

@passivestar
Copy link
Contributor Author

Fixed by #86553

I'm afraid not

Screenshot 2024-04-18 at 19 32 01

@smnast
Copy link
Contributor

smnast commented Apr 19, 2024

It seems, in fact, to not be fixed by #86553.

minsize.height += 0.5 * win_scale; // Ensures enough height at fractional content scales to prevent the v_scroll_bar from showing.

Adding 0.5 before set_min_size() truncates to integers rounds down when the decimal height is less than 0.5, like round(). Would it not make more sense to ceil the values instead?

@passivestar
Copy link
Contributor Author

@akien-mga should this be reopened?

@Koyper
Copy link
Contributor

Koyper commented Apr 24, 2024

Adding 0.5 before set_min_size() truncates to integers rounds down when the decimal height is less than 0.5, like round(). Would it not make more sense to ceil the values instead?

I think you're right about this, and I'm not sure exactly why the rounding down behavior was working correctly (it tested correctly). I changed it so that #91114 uses ceil() for consistency with the fix for embedded windows.

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