Since matrices are usually indexed **row first**, displaying matrices in
the UI seems flipped.
They are stored as flat arrays.
When `matrix[1][0]` is accessed via python, the logic from
`pyrna_py_from_array_index` will actually look up index 2 in the flat
array (rightfully so).
But UI code was flipped in that regard.
The second value in the flat array **should** show at row 1 column 0,
but it currently doesnt.
Now (hopefully) handled properly (not only in `ui_item_array` but also
made code in `ui_item_rna_size` detect proper row count for a `height`)
Pull Request: https://projects.blender.org/blender/blender/pulls/148197
This adds unobtrusive tab button for selecting displayed tabs to the
tabs region. The idea is, that this way, the filter is much more
discoverable than it being hidden in options popover. The button is
grayed out, when all tabs are visible.
To only draw arrow, is achieved by setting `UILayout.emboss` to `NONE`
or `NONE_OR_STATUS`
Pull Request: https://projects.blender.org/blender/blender/pulls/135132
Following to the uiLayout refactor, this converts each
layout resolve function as virtuals methods, so `x_`, `y_`,
`w_` and `h_` properties can become protected.
No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/146185
Similar to !145387, disable layout when rna property is non editable.
Let the widget code handle the theme of the label in
front of the non-editable property. Also do it separately inside
`v3d_object_dimension_buts` for transform properties of N-panel
Resolves#146290
Pull Request: https://projects.blender.org/blender/blender/pulls/146565
Following the uiLayout refactor, this converts each layout estimate
function as virtuals methods, so w_ and y_ properties can become
protected. This includes missing structs for each layout type in
`uiItemType`, but without the `ui` prefix (they eventually will be
moved to the to the `blender::ui` namespace instead)
Pull Request: https://projects.blender.org/blender/blender/pulls/146049
When using `emboss=False` on a UI prop, if `property_split` was
enabled, all subsequent props in the same layout would also be
unembossed.
This is because of the way the emboss status was set.
When drawing a prop, the previous emboss status was stored in a
temporary variable `prev_emboss`. This status was retrieved from the
uiLayout (`this`), but restored to a `layout` uiLayout that could be
another one, because it could be reassigned in the mean while.
Instead the status should just be restored to `this`, otherwise the
layout can keep the same unembossed status for subsequent props.
Pull Request: https://projects.blender.org/blender/blender/pulls/145883
This makes child_items_layout_, scale_, align, active_,
active_default_, activate_init_, enabled_, redalert_,
variable_size_, alignment_, emboss_, units_ & search_weight_
private members as follow up from recent UI refactors.
Pull Request: https://projects.blender.org/blender/blender/pulls/145844
This PR adds an optional block alert level, defaulting to none. Then
for error-level alerts only it adds a red line and a color icon.
Dialogs with other alert types do not change at all. This also adds
a UI_alert function to create such dialogs.
Pull Request: https://projects.blender.org/blender/blender/pulls/134084
This patch redesigns the File Output node to provide better UX and UI.
This is mainly achieved by allowing the user to create inputs by
dragging into an Extend socket and adjust existing inputs using the
familiar UI list design available in Blender. Additionally, various UI
changes were done:
- The Use Node Format option was renamed to Override Node Format for
clarity.
- Socket types are now fixed and do not change as new links are made,
allowing users to specify the exact output type and employ implicit
conversion if needed.
- The distinction between images and Multi-Layer EXR was made clearer.
- Final output paths are drawn in the UI to remove guess work.
- The Base Path was split into a Directory and a File Name.
- Panels were added to group options, include a panel for the node
format, items, and item formats.
Pull Request: https://projects.blender.org/blender/blender/pulls/141091
This converts `eButType` and `eButPointerType` as typed enums.
This improves a bit `uiDefBut` self-documentation by taking an
struct with `ButType` and `ButPointerType` types, instead of
using a single `int` to write both enum types and bit index.
Almost all other `uiDefBut*` functions take just a `ButType`
parameter now.
`uiDefButI` for example is equivalent to:
`uiDefBut({ButType(type), ButPointerType::Int},...);`
Pull Request: https://projects.blender.org/blender/blender/pulls/142132
Mistake in 2658754324.
This was changed from a free standing to a member function during review. But
forgot to update the parameters accordingly. This can be confusing since you
can call the function on one layout, but pass it another one that it will
actually operate on.
For blender/blender!141292, we need a simple icon and text button that
executes a callback on click. The size should be determined based on the
text and icon, as it's typically done with the `UI_interface_layout.hh`
API. Trying to do this with `uiDefIconTextBut()` is annoyingly
complicated, mostly because we'd have to duplicate size calculations.
Instead expand the `UI_interface_layout.hh` API to cover this.
* Allow passing a button type to `uiItemL_()` and rename it to
`uiItem_simple()`. The code in this function is commonly useful, not
just for label buttons. It's a convenient way to add a single button
with normal size calculations. The function stays internal to
`interface_layout.cc`.
* Add `uiItemBut()` as public API function to call this and assign an
on-click callback.
No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/141900
The goal is to be able to build fully custom tooltips for entire layouts (e.g.
for all `uiBut` for a socket). We already support tooltip callbacks for layouts
and fully custom tooltips for `uiBut`, however not fully custom tooltips for an
entire layout.
This will be used by #140540.
The main noteworthy thing here is that now `uiBut` is passed into the custom
tooltip function. This is necessary when the tooltip still has to be customized
for the exact hovered `uiBut`. For example, we generate a tooltip that applies
to an entire vector socket, but when hovering over e.g. the X input value, the
Python tooltip should show the path for that specific property.
This also fixes a bug in `ui_but_is_interactive_ex` which didn't consider custom
and quick tooltips before.
`uiLayoutSetTooltipCustomFunc` is pretty much the same as its non-custom
counterpart.
Pull Request: https://projects.blender.org/blender/blender/pulls/142044
Similar to other removed UI layout functions, this removes uiItemEnumO*
functions and replaces them by calling `uiLayout::op` and writing enum
properties to the returned RNA pointer.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141632
This renames UI_block_layout API as blender::ui::block_layout_resolve,
following uiLayout refactors.
This simplifies usage by returning block layout size as C++ int2 instead
of using return parameters, in fact some places were providing
unused variables.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141432
This renames `UI_block_layout` API as `blender::ui::block_layout`,
following uiLayout refactors.
This function now returns a layout reference instead of pointer,
this changes applies this return type where the layout can be used
as such reference.
Changes includes the use of `blender::ui::LayoutDirection` and
`blender::ui::LayoutType` as typed enum parameters.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141401
Almost all uiLayout methods that creates sub-layouts returns a uiLayout
reference, API users must use the returned sub-layout to add items,
this prevents a accidental copy that could break Blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/141051
This replaces uiItemMContents, uiItemDecoratorR* and
uiItemProgressIndicator API with uiLayout methods following
uiLayout refactors and the Python API.
`eButProgressType` is changed to a typed enum class
`blender::ui::ButProgressType`
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141189
This replaces `uiItemFullOMenuHold_ptr`, `uiItemFullR_with_popover`,
`uiItemFullR_with_menu`, `uiItemPopoverPanel`* and `uiItemSpacer` API
with methods following uiLayout refactors and the Python API.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141050
This replaces API for accessing the uiLayout fixed_size,
red_alert, root_panel, search_weight and width properties
with methods, following uiLayout refactors and the
Python API naming
Pull Request: https://projects.blender.org/blender/blender/pulls/140673
This removes the include `UI_interface_layout.hh` from
`UI_interface_c.hh`, and in many places this swaps the include
from `UI_interface.hh` to `UI_interface_layout.hh`.
Also, cleanups some `UI_interface.hh` includes with
`UI_interface_icons.hh` or `UI_interface_types.hh`
This replaces uiLayout aligment API with uiLayout methods,
following uiLayout refactors and the Python API naming.
Also this converts the layout aligment enum to a fixed enum class.
Pull Request: https://projects.blender.org/blender/blender/pulls/140622
This replaces API for accessing the uiLayout active_default,
acviated_init, enabled properties with methods, following uiLayout
refactors and the Python API naming.
Pull Request: https://projects.blender.org/blender/blender/pulls/140226