X Tutup
Skip to content

PopupMenu: Fix minimum size for items with icons#112377

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
timothyqiu:popup-menu-minsize
Nov 6, 2025
Merged

PopupMenu: Fix minimum size for items with icons#112377
Repiteo merged 1 commit intogodotengine:masterfrom
timothyqiu:popup-menu-minsize

Conversation

@timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented Nov 4, 2025

Currently, when there are items with icons, PopupMenu's minimum width is one h_separation narrower than drawn. This isn't that noticeable, because h_separation is relatively small and PopupMenu typically has larger paddings introduced by the scrollbar and the background stylebox.

This PR also did a bit clean-up as the code for calculating the minimum size has a few unnecessary complexity, probably due to continuous evolution.

Run this test project and click the Popup button: test-4.zip

@timothyqiu timothyqiu requested a review from a team as a code owner November 4, 2025 08:36
@Chaosus Chaosus added this to the 4.6 milestone Nov 4, 2025
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

Seems to be working as expected:

Before After
Image Image

@Repiteo Repiteo merged commit a7bf615 into godotengine:master Nov 6, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 6, 2025

Thanks!

@timothyqiu timothyqiu deleted the popup-menu-minsize branch November 6, 2025 16:05
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.

4 participants

X Tutup