UI: support UI_ITEM_R_IMMEDIATE all RNA buttons
This was only being checked for key-map entry buttons however this is useful to enable immediate editing of text fields.
This commit is contained in:
@@ -1112,15 +1112,16 @@ static uiBut *ui_item_with_label(uiLayout *layout,
|
||||
0,
|
||||
nullptr);
|
||||
UI_but_func_set(but, ui_keymap_but_cb, but, nullptr);
|
||||
if (flag & UI_ITEM_R_IMMEDIATE) {
|
||||
UI_but_flag_enable(but, UI_BUT_ACTIVATE_ON_INIT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const char *str = (type == PROP_ENUM && !(flag & UI_ITEM_R_ICON_ONLY)) ? nullptr : "";
|
||||
but = uiDefAutoButR(block, ptr, prop, index, str, icon, x, y, prop_but_width, h);
|
||||
}
|
||||
|
||||
if (flag & UI_ITEM_R_IMMEDIATE) {
|
||||
UI_but_flag_enable(but, UI_BUT_ACTIVATE_ON_INIT);
|
||||
}
|
||||
|
||||
#ifdef UI_PROP_DECORATE
|
||||
/* Only for alignment. */
|
||||
if (use_prop_decorate) { /* Note that sep flag may have been unset meanwhile. */
|
||||
|
||||
Reference in New Issue
Block a user