I’m in the process of adding the rest of bevel’s options to the active tool so that it can be a useful alternative to the modal tool. I’ve run into the situation where it makes sense to define a separate interface for the header and non-header versions of the UI (the issue pictured below).
I would like to draw the list of boolean options with a menu or popover in the header, but to do that I need to detect the region it’s drawing in. Something like this seems like the intuitive solution, but they’re both Horizontal
, and I haven’t found another way to do this.
@ToolDef.from_fn
def bevel():
def draw_settings(_context, layout, tool):
props = tool.operator_properties("mesh.bevel")
# I'd like to detect region (header or N-panel / properties
if layout.direction == 'VERTICAL': # NOT HEADER
...
else: # HEADER
...
Any ideas?