Was causing temporal sampling artifacts when scene is set to Cycles
and viewport is set to Eevee. Visually was looking like ghosting or
motion blur when moving objects.
Was using classes to define tools, however this makes it awkward to
dynamically generate them (we can do it, but its not very "Pythonic").
Move to a named tuple.
Dynamically sized regions in the topbar were flickering due to only updating
their size after redraws. Now there is an optional layout() callback for
all regions in an area to do UI layout first, then refresh the region layout,
and then do the actual drawing for each region.
Task T54753
* This is just moving buttons to get a bit closer to the intended design,
better naming and layout is needed.
* Popovers currently work best when the 3D view header is at the top, with
the most important settings nearest to the mouse. Open design question is
if we should flip (part of) the buttons if header is at the bottom.
* Another question is if selecintg a shading mode enum should immediately
close the popover since those are changed often, unlike the other settings
for which it seems more convenient to keep the popover open.
This is to address things like a percentage slider with a fixed soft mininum.
For example, the render resolution ranges from 1% to 100% and it is really
strange to have the slider showing nothing filled when the ui shows 1%.
Now we always fill the slider with a vertical boundary. A bit hard to explain,
but very easy to see the difference.
I split the widget in three parts and used fragment shader discard to remove the
undesired bits. That means all the widget program is doing a bit extra
calculation.
Reviewers: fclem
Subscribers: billreynish
Differential Revision: https://developer.blender.org/D3186
U.ui_scale is the setting from the user preferences and should never be used
for drawing. UI_DPI_FAC is the final scale after DPI from the operating system
is taken into account.
Having single & multi-column checks inline were becoming unmanageable.
Use a generator to define the layout,
allows for easily adding different layouts in the future.