diff options
author | Julian Eisel <julian@blender.org> | 2020-09-04 22:18:45 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-09-04 22:26:31 +0300 |
commit | e6f0b60c2e9111af1878d31dcc295c59ed1bea77 (patch) | |
tree | 4df10fc869f5f512c233a2755246c1749bafc1c7 /source/blender/editors/include/UI_interface.h | |
parent | 47881791be0538f9558b2ef091e1761187df250d (diff) |
UI Code Quality: Use derived struct for number buttons
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).
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b23f8ae11c9..d5d489b1742 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1602,6 +1602,9 @@ int UI_search_items_find_index(uiSearchItems *items, const char *name); void UI_but_node_link_set(uiBut *but, struct bNodeSocket *socket, const float draw_color[4]); +void UI_but_number_step_size_set(uiBut *but, float step_size); +void UI_but_number_precision_set(uiBut *but, float precision); + void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg); void UI_block_func_butmenu_set(uiBlock *block, uiMenuHandleFunc func, void *arg); void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2); |