Age | Commit message (Collapse) | Author |
|
|
|
Allow Trackpad Ctrl-Pan to cycle enum values. Also allows cycling in more button types.
Differential Revision: https://developer.blender.org/D8535
Reviewed by Brecht Van Lommel
|
|
ASAN reported a use after free in after rB15d78ea85b602c. This commit
removed a reassignment of the `data` variable here that was actually
required because it may have been freed earlier in the function. This
sort of error would be avoided if the same variable wasn't reused for
different purposes.
|
|
This means if a keymap item is set to ignore repeat events,
it may do so accidentally from this setting being copied.
|
|
Corrects 34 miscellaneous misspelled words.
Differential Revision: https://developer.blender.org/D9248
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
|
|
Follow our code style guide by using C-comments for text descriptions.
|
|
Minor change missing from 9bfea67751dc59554c8928802b4e1f04278ab537
Ref D8530
|
|
We have our own assert implementation, `BLI_assert()` that is prefered over the
C standard library one. Its output is more consistent across compilers and
makes termination on assert failure optional (through `WITH_ASSERT_ABORT`).
In many places we'd include the C library header without ever accessing it.
|
|
3D Viewport -> Sidebar -> View -> Local Camera is disabled. When you
click on it, box select starts. This behavior isn't intended, and fixing
it is quite simple. The only case where this would continuing would
still be desired is if a disabled button overlapped with a non-disabled
button, but this shouldn't be the case anywhere.
Differential Revision: https://developer.blender.org/D8832
|
|
Instead of indenting the entire functional block, check for the error
case and the supported case early to make the code more readable.
|
|
Cleanup old tracker task format to the new. e.g: [#34039] to T34039
Ref D8718
|
|
Do a proper check to see if the button supports Ctrl+Mousewheel cycling.
See T80659.
|
|
|
|
For example you can now start entering text in the Properties or
Outliner search, and press the 'x' while the button is still in
text-edit mode.
This way you don't have to exit text editing first, before being able to
quickly clear the string with a mouse click. So this is a small
improvement for convenience.
It also works for the eyedropper (change to picking an object while text
editing) or the '+' and '-' icons in the file saving dialog.
|
|
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.
|
|
The hotspot was slighly too large, which could be apparent in cases
where there are multiple superimposed icons.
|
|
|
|
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
|
|
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).
|
|
- Declare variables where they are initialized
- Use consistent variable and static function names
- Use helper functions more for common operations
- Remove use of BezTriple struct, use CurveProfilePoint instead
- Apply small simplifications to code in some situations
|
|
No functional changes.
|
|
|
|
Explain why some features have defines,
also use doxy sections for defines & prototypes.
|
|
|
|
|
|
Further changes to interface_handlers.c to avoid a block of variable
declarations at the beginning of functions. Also use const in some
situations. I only made changes where the variable's intended scope
was obvious.
|
|
- Reduce variables scope
- Use some const prefixes
- Initialize variables at declaration
- Use comparison to boolean false instead of 0
Differential Revision: https://developer.blender.org/D8678
|
|
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
|
|
|
|
Changing line-width shouldn't scale cursor motion. Related to T79787.
Use dpi_fac for scaling curve error threshold & number button drag
threshold calculation.
|
|
There was a false positive here. Thankfully, marking the button's type
as constant can quiet the warning.
|
|
The same changes as rB570044e9f412 and rB0ab21bf06ae0.
|
|
The same changes as in rB570044e9f412.
|
|
Continuing the work from rB49f088e2d093.
Differential Revision: https://developer.blender.org/D8561
|
|
Caused by dcff28e1e7a8.
|
|
For the main rationale behind this design, see 49f088e2d093. Further,
this removes users of uiBut.a1, which is a very ugly design
choice (hard to reason about).
Part of T74432.
|
|
For the main rationale behind this design, see 03b122e2a18df. Further,
this removes users of `uiBut.a1`/`uiBut.a2`, which is a very ugly design
choice (hard to reason about).
Part of Part of T74432.
|
|
The current on-size-fits-all `uiBut` creates quite a mess, where it's
hard to reason about which members are free for use, under which
conditions they are used and how.
`uiBut` also has members that aren't used at times, violating the "don't
pay for what you don't use" principle.
To address this, we want to move to typed buttons, where `uiBut` is just
a base struct and each type extends it as needed. That structures data
better and type specific data is only available if it's actually used by
a button type.
Two trade-offs:
* Many casts to the derived type have to be done.
* Sometimes we change the button type after it's created. So I had to
add logic to reallocate the button for use with the new, possibly
derived struct. Ideally that wouldn't be needed, but for now that's
what we have.
Part of T74432.
Differential Revision: https://developer.blender.org/D7610
Reviewed by: Brecht Van Lommel, Campbell Barton
|
|
|
|
|
|
The icons are label buttons. Usually these are not editable and can not
become active. These are draggable ones though (so dragging files can be
dragged by dragging the icon) which creates an exception to this rule.
So hovering the icon would activate its label and when executing the
rename operator via shortcut it wouldn't get exited properly. This broke
the invariant of only allowing a single active button at a time.
Added an assert to check that invariant now.
Letting the code to activate the text button ensure any currently active
button is exited seems sensible.
|
|
|
|
Disabled buttons would incorrectly toggle state when a drag toggle
passed over them. This adds a check to prevent a drag toggle on disabled
buttons.
Differential Revision: https://developer.blender.org/D8476
|
|
|
|
button
This was reported for the FCurve modifier restrict ranges, but might fail
elsewhere, too. Reason is that the post_but has its range (hardmin/
hardmax etc) set before the updates to the active button take place, so
changes here dont end up on the post_but (even though the RNA range
function is properly called for a new defined button - new one is not the
same as the post_but though).
Now update the ranges on the post_but when that gets active.
Fixes T78763
Maniphest Tasks: T78763
Differential Revision: https://developer.blender.org/D8265
|
|
*_LEN follows names elsewhere in Blender more closely than "_N_"
|
|
Use 'emboss' instead of 'draw_type' as enum, layout & functions use
the term emboss.
This issue was noted by @Poulpator in D8414, as `dt` is also an
abbreviation for delta-time.
|
|
Also rename ui_but_string_set_eval_num to ui_but_string_eval_number
as it doesn't set any of the buttons values.
|
|
|