Age | Commit message (Collapse) | Author |
|
Re-enables support for menus to have items without identifier or name that can be used to separate sections.
Differential Revision: https://developer.blender.org/D9463
Reviewed by Hans Goudey
|
|
The current layout gave too little space for the full "Search" string inside
the button.
Fix this by making sure radio-buttons have their text center aligned by default
in pop-ups too, like they do anywhere else.
This does affect a few other cases, e.g. the "RGB"/"HSV"/"Hex" radio-toggles
for color pickers. But this should be fine, I don't think they were ever
intentionally using left-aligned text (while similar buttons outside of pop-ups
didn't).
|
|
|
|
The list of buttons in the button group needs to be updated to take into
account the old button inserted into the button list for the new block.
Differential Revision: https://developer.blender.org/D9428
|
|
|
|
Follow our code style for doxygen sections.
|
|
This commit contains some improvements to this function to make this
function more purposeful and readable.
- Split updating information of the old button to a new function.
- Remove some 7 year old code disabled with `#if 0`.
- Add comments explaining some of the less obvious aspects.
Differential Revision: https://developer.blender.org/D9117
|
|
This means if a keymap item is set to ignore repeat events,
it may do so accidentally from this setting being copied.
|
|
Menus with categories gain a dividing line and omit the title.
Differential Revision: https://developer.blender.org/D5135
Reviewed by Brecht Van Lommel
|
|
Corrects incorrect usages of the words 'then' and 'than'.
Differential Revision: https://developer.blender.org/D9246
Reviewed by Campbell Barton
|
|
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.
Differential Revision: https://developer.blender.org/D9250
Reviewed by Campbell Barton
|
|
With all the work on DNA defaults for 2.91, it's nice to expose this
convenient operator. This was already hardcoded in the UI code to the
backspace key, adding it to the keymap instead will make the shortcut
automatically show in the button right click menu.
Differential Revision: https://developer.blender.org/D9219
|
|
Changing the color of monochrome alert icons would not change until the theme was reloaded.
Differential Revision: https://developer.blender.org/D9062
Reviewed by Harley Acheson
|
|
Change to monochrome version of the large alert icons and use 'Question' for the the Quit Confirm dialog box.
Differential Revision: https://developer.blender.org/D9062
Reviewed by Pablo Vazquez
|
|
Follow our code style guide by using C-comments for text descriptions.
|
|
This makes it unecessary to create a button group when the block
is created, giving more flexibility when creating the first group-- for
example, creating the first button group with special parameters.
|
|
For a future patch (D9006) we need these groups for longer than just the
the layout process, in order to differentiate buttons in panel headers.
It may also be helpful in the future to have a way to access related
buttons added in the same uiLayout.prop call. With this commit, the
groups are stored in and destructed with the uiBlock.
|
|
Now versioning UserDef is run in readfile.c,
as is done for other Blender data.
Previously versioning was mixed with other run-time initialization,
so it needed to be called later by the window manager.
|
|
Version patching userpref.blend wasn't using the correct version,
causing settings not to be properly updated.
This seems the likely cause of T70196 and similar bugs.
|
|
Error in 9b6c5268bc20. Also move variable declaration to where it's
used to reduce confusion.
|
|
Cleanup old tracker task format to the new. e.g: [#34039] to T34039
Ref D8718
|
|
|
|
Where the if statement was just a check for an error or an unhandled
condition and there are no else statements, the rest of the function
doesn't need to be indented.
|
|
Also use "r_" prefix for return arguments in a few places.
|
|
Since the search is applied all in one phase, there is no need to store
a reference to the search filter in every uiBlock. Instead just pass it
as an argument to UI_block_apply_search_filter.
|
|
It's generally considered a better codestyle to check conditions early
and exit early when they are not met, over having most logic of a
function within a big `if`-block. Otherwise people have to go over the
entire block to see if there's possibly an `else` somewhere, or any
followup logic.
|
|
There's the old and ugly hack where the `uiBut.poin` points to the
button itself. When reallocating the button we have to update that
pointer of course.
|
|
The function this was in already checks the conditions under which it
can operate (as it should). No need to force the caller to do these
(quite specific) checks, the function can just do nothing if the button
doesn't need these operations.
Otherwise we'd have to always execute these checks before calling, which
makes calling it a hassle, makes the code harder to follow and generally
harder to maintain (what if the conditions change?).
|
|
E.g. the 'x' icons or eyedropper icons in text buttons. They didn't use
to have any mouse over feedback, now we dim the icon until hovered.
This kind of feedback helps users see that the icons are interactive,
and if they are within their interaction hotspot.
|
|
- UI_collection_color_icon_get -> UI_icon_color_from_collection
- UI_idcode_icon_get -> UI_icon_from_idcode
- UI_library_icon_get -> UI_icon_from_library
- UI_mode_icon_get -> UI_icon_from_object_mode
- UI_rnaptr_icon_get -> UI_icon_from_rnaptr
- UI_alert_image -> UI_icon_alert_imbuf_get
- UI_preview_render_size -> UI_icon_preview_to_render_size
- UI_id_icon_render -> UI_icon_render_id
|
|
|
|
This adds a search bar to the properties editor. The full search for
every tab isn't included in this patch, but the interaction with
panels, searching behavior, UI, region level, and DNA changes are
included here.
The block-level search works by iterating over the block's button
groups and checking whether they match the search. If they do, they
are tagged with a flag, and the block's panel is tagged too. For
every update (text edit), the panel's expansion is set to whether
the panel has a result or not. The search also checks for matching
strings inside enums and in panel labels.
One complication to this that isn't immediately apparent is that
closed panel's subpanels have to be searched too. This adds some
complexity to the area-level panel layout code.
Possible Future Improvements:
- Use the new fuzzy search in BLI
- Reset panels to their expansion before the search started if
the user escape out of the text box.
- Open all child panels of a panel with expansion.
Differential Revision: https://developer.blender.org/D8856
|
|
This is needed for property search (upcoming patch D8856) where a
buttons labels are often separate buttons, but we need to highlight
the label to show that a property is a search result. This is
especially important in "property split" layouts where the label is
almost always another button in a separate column.
The button groups here are basically a flattened view of the buttons
in the layout tree. Every function that adds a new set of buttons
creates a new button group, and the new buttons are automatically
added to the most recent group. Then, each group is searched
separately in the property search phase. It's important that every
function adding a new button set calls layout_root_new_button_group.
Note that this won't be disabled when property search isn't active.
It may be useful for other things in the future, and trying to pass
that information to layout functions didn't feel worth it to me.
Differential Revision: https://developer.blender.org/D8783
|
|
This adds support for drawing icon buttons as a row in menus. This is
needed for drawing collection color tagging icons in the outliner
context menu in T77777.
Part of T77408
Differential Revision: https://developer.blender.org/D8317
|
|
MSVC warns on MEM_freeN being fed a const pointer
|
|
This commit renames the functions in "BKE_unit.h` to be consistent
with the naming in the rest of blenkernel.
bUnit_AsString -> BKE_unit_value_as_string_adaptive
bUnit_AsString2 -> BKE_unit_value_as_string
bUnit_ReplaceString -> BKE_unit_replace_string
bUnit_ApplyPreferredUnit -> BKE_unit_apply_preferred_unit
bUnit_ToUnitAltName -> BKE_unit_name_to_alt
bUnit_ClosestScalar -> BKE_unit_closest_scalar
bUnit_BaseScalar -> BKE_unit_base_scalar
bUnit_IsValid -> BKE_unit_is_valid
bUnit_GetSystem -> BKE_unit_system_get
bUnit_GetBaseUnit -> BKE_unit_base_get
bUnit_GetBaseUnitOfType -> BKE_unit_base_of_type_get
bUnit_GetName -> BKE_unit_name_get
bUnit_GetNameDisplay -> BKE_unit_display_name_get
bUnit_GetIdentifier -> BKE_unit_identifier_get
bUnit_GetScaler -> BKE_unit_scalar_get
bUnit_IsSuppressed -> BKE_unit_is_suppressed
Differential Revision: https://developer.blender.org/D8828
|
|
Blender does string based searching in many different places.
This patch updates four of these places to use the new string
search api in `BLI_string_search.h`.
In the future we probably want to update the other searches as well.
Reviewers: Severin, pablovazquez
Differential Revision: https://developer.blender.org/D8825
|
|
-1 is a valid value to pass as RNA float precision. We let the UI code
figure out an appropriate precision then. So don't fail the assert if
-1 is passed.
|
|
For the man rationale behind this design, see 49f088e2d093. Further,
this removes users of uiBut.a1/uiBut.a2, which is a very ugly design
choice (hard to reason about).
Note that I had to do rather ugly, specific exceptions for the number
buttons in `ui_def_but_rna()`. But once all users of a1/a2 are removed,
this special handling shouldn't be needed anymore.
I also had to move a sanity check out of the button definition. It's now
moved into a new debug only sanity checking function executed when
finishing the layout definition (block end).
|
|
This was reported for the "Add Node" search functionality, but is
relevant in other searches as well.
So e.g. when searching for "Separate XYZ", typing "sep", then " " (with
the intention to type "X" next) would clear the search field. Now use
the same method (matching against all search words) as in F3 searching
('menu_search_update_fn') in other searches as well [searching IDs,
property objects, finding nodes,...]
This should give a much nicer search experience in general.
Note: this does not touch other searches in the Dopesheet, Outliner,
Filebrowser or User Preferences that have other search implementations.
Maniphest Tasks: T78084
Differential Revision: https://developer.blender.org/D8232
|
|
We do this in a couple of places, so it's worth having the logic wrapped
into a function.
Also, the only way to set the disabled hint for a button from outside of
`interface/` was through `UI_block_lock_set()`/`UI_block_lock_clear()`,
for which the usage isn't obvious when you just try to disable a single
button.
|
|
- Use WM_operatortype_description to get the operator description.
- Pass properties to WM_operatortype_name,
so the operator name callback is used.
- Add UI_but_operatortype_get_from_enum_menu function
to access the operator from enum menus.
- Change WM_operatortype_description to return NULL when there is no
description, use WM_operatortype_description_or_name
when either can be used.
|
|
Display negative zero floats as regular zero. Does not alter underlying value.
Differential Revision: https://developer.blender.org/D4795
Reviewed by Brecht Van Lommel
|
|
|
|
I only skipped a few loops in the monstrous ui_handle_menu_event
function. Also, I only changed variable names where necessary to
prevent redeclarations.
Differential Revision: https://developer.blender.org/D8586
|
|
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
|
|
|
|
|
|
Final releases (including beta) should strictly show features that are
finalized to prevent loss of data, old API clanging around, and the
overall quality of the product (Blender) presented.
Note that rendering should never be affected by user preferences, so
this is only changing things in the UI level.
Development note: This is reset experimental UI on file load.
Also note: to hide RNA (needed for hair and particles) will be done as a
separate patch.
Differential Revision: https://developer.blender.org/D8606
|
|
This commit renames 'execute' to 'run' because:
- This follows Python's "PyRun" which these functions wrap.
- Execution functions can use either exec/eval modes,
making naming awkward (for future API refactoring).
|