Merge branch 'blender2.7'

This commit is contained in:
Brecht Van Lommel
2019-03-14 19:00:10 +01:00
7 changed files with 19 additions and 6 deletions

View File

@@ -3191,7 +3191,7 @@ static void ui_but_build_drawstr_int(uiBut *but, int value)
* \param validate: When set, this function may change the button value.
* Otherwise treat the button value as read-only.
*/
void ui_but_update_ex(uiBut *but, const bool validate)
static void ui_but_update_ex(uiBut *but, const bool validate)
{
/* if something changed in the button */
double value = UI_BUT_VALUE_UNSET;
@@ -3199,7 +3199,7 @@ void ui_but_update_ex(uiBut *but, const bool validate)
ui_but_update_select_flag(but, &value);
/* only update soft range while not editing */
if (!(but->editval || but->editstr || but->editvec)) {
if (!ui_but_is_editing(but)) {
if ((but->rnaprop != NULL) ||
(but->poin && (but->pointype & UI_BUT_POIN_TYPES)))
{

View File

@@ -6979,6 +6979,12 @@ bool ui_but_is_active(ARegion *ar)
return (ui_but_find_active_in_region(ar) != NULL);
}
bool ui_but_is_editing(uiBut *but)
{
uiHandleButtonData *data = but->active;
return (data && ELEM(data->state, BUTTON_STATE_TEXT_EDITING, BUTTON_STATE_NUM_EDITING));
}
/* is called by notifier */
void UI_screen_free_active_but(const bContext *C, bScreen *screen)
{

View File

@@ -523,7 +523,6 @@ extern uiButExtraIconType ui_but_icon_extra_get(uiBut *but);
extern void ui_but_default_set(struct bContext *C, const bool all, const bool use_afterfunc);
extern void ui_but_update_ex(uiBut *but, const bool validate);
extern void ui_but_update(uiBut *but);
extern void ui_but_update_edited(uiBut *but);
extern bool ui_but_is_float(const uiBut *but) ATTR_WARN_UNUSED_RESULT;
@@ -728,6 +727,7 @@ extern void ui_but_execute_begin(struct bContext *C, struct ARegion *ar, uiBut *
extern void ui_but_execute_end(struct bContext *C, struct ARegion *ar, uiBut *but, void *active_back);
extern void ui_but_active_free(const struct bContext *C, uiBut *but);
extern bool ui_but_is_active(struct ARegion *ar) ATTR_WARN_UNUSED_RESULT;
extern bool ui_but_is_editing(uiBut *but);
extern int ui_but_menu_direction(uiBut *but);
extern void ui_but_text_password_hide(char password_str[UI_MAX_DRAW_STR], uiBut *but, const bool restore);
extern uiBut *ui_but_find_select_in_enum(uiBut *but, int direction);