UI Code Quality: Use derived struct for number buttons
For the man rationale behind this design, see 49f088e2d0. 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 commit is contained in:
@@ -164,7 +164,7 @@ uiBut *uiDefAutoButR(uiBlock *block,
|
||||
}
|
||||
else {
|
||||
but = uiDefButR_prop(
|
||||
block, UI_BTYPE_NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
||||
block, UI_BTYPE_NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, 0, 0, NULL);
|
||||
}
|
||||
|
||||
if (RNA_property_flag(prop) & PROP_TEXTEDIT_UPDATE) {
|
||||
|
||||
Reference in New Issue
Block a user