X Tutup
Skip to content

PopupMenu: Add theme option for merging icon and checkbox gutters#112545

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
timothyqiu:compact-menu-gutter
Nov 10, 2025
Merged

PopupMenu: Add theme option for merging icon and checkbox gutters#112545
Repiteo merged 1 commit intogodotengine:masterfrom
timothyqiu:compact-menu-gutter

Conversation

@timothyqiu
Copy link
Member

Closes #37178
Closes #109578

This PR adds a gutter_compact theme constant which acts as a boolean. If true, the icon gutter will be merged with the checkbox gutter when possible (the exception is when there is a menu item that has both an icon and a checkbox).

The default theme sets this constant to 1. It's an option as there are different established styles in the wild, see examples in the linked issues.

Before After
before after

Peek 2025-11-08 22-56

@Mickeon
Copy link
Member

Mickeon commented Nov 8, 2025

Oh goodness me, thank you. This has been bothering me for so long. It's egregiously bad in a node's right-click menu, too.

Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

This makes me greatly question when is it ever a bad idea to make icons and checkboxes compact whenever possible. I genuinely can't think of a reason not to.

@timothyqiu
Copy link
Member Author

when is it ever a bad idea to make icons and checkboxes compact whenever possible.

I don't believe there's an absolute right or wrong here. Different projects can have different design conventions. For example, this KCalc menu separates icons and checkboxes:

Image

@Mickeon
Copy link
Member

Mickeon commented Nov 9, 2025

Alright, but forgive me if I'm wrong: Wouldn't it also be possible to replicate KCalc's and the current behavior by assigning a texture to any checkbox option, even a dummy texture? The theme item is good, I suppose, but the workaround is totally possible if absolutely desired.

@timothyqiu
Copy link
Member Author

Wouldn't it also be possible to replicate KCalc's and the current behavior by assigning a texture to any checkbox option, even a dummy texture?

Yes, it works. It's mainly a matter of proper support vs. hack-your-own-way-through :P

Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

Docs okay. Not sure about implementation.

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.

Code looks good, seems to be working as expected.

@bruvzg
Copy link
Member

bruvzg commented Nov 9, 2025

Different projects can have different design conventions. For example, this KCalc menu separates icons and checkboxes:

For the reference, macOS menus usually use two columns for icon and checkmark as well (but indent for different items can change), but at least in context of Godot editor it makes sense to use compact mode:

Screenshot 2025-11-09 at 18 04 07

@Repiteo Repiteo merged commit 31867ab into godotengine:master Nov 10, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 10, 2025

Thanks!

@timothyqiu timothyqiu deleted the compact-menu-gutter branch November 10, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants

X Tutup