Page MenuHome

Indicate which button gets activated when you hit Return
Closed, ResolvedPublic


Currently, in any modal popup, we have a button that is activated when the user hits Return. However, we don't communicate this at all. We should highlight the button that gets activated when the user hits Return, like so:

Event Timeline

William Reynish (billreynish) triaged this task as Normal priority.

Would it be better to add this theme value to ThemeUI or ThemeSpace. It looks like it being in ThemeSpace allows it to be overridden for different contexts while ThemeUI is global?

Related, In theme UI many of the fields are named like wcol_regular, is this to mean Wide (4bytes) Color named regular?
Both of these structs are defined in makesdna/DNA_userdef_types.h

Thank you for your time.

@Eric Fode (ericfode) Since this is only needed for action buttons (strangely called Tool buttons in Blender parlance - don't confuse with Toolbar buttons), I would have presumed the most straight forward way would be to add another entry there.

@Pablo Vazquez (pablovazquez): Any opinion on this?

Thanks for looking into this @Eric Fode (ericfode) !

Let's try to avoid new theme settings, we have too many.

I think we can re-use the active state of a button (the one when you click/hold a button). Then, what happens when you click/hold on that focused button? We could re-use the same colors as active but make the background (inner_selected) slighly darker (0.2f or so). Since we're pressing down I think making it darker makes sense.

So a focused button would look like this:

Maybe it could be as simple as adding


to the UI layout engine. Meaning:

layout.operator("something", focused=True)

to buttons that will activate when pressing Return. This would use the active state for operator buttons.

With this solution, it won't appear automatically, but I think that's fine too. We can manually add this to the places where this is needed.

@Campbell Barton (campbellbarton) How would you prefer this was handled, technically?

Here's a list of places I could find where we should apply this:

File Browser Open/Save/Append/Link button:

Move to Collections OK button:

There are probably more, but cannot think of them for now. Will update as I find more.