Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-03-14 21:00:10 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-03-14 21:00:10 +0300
commit81a03e17f759316bb40fa4bd416bc2d8d3131bb6 (patch)
treefad7b9ab268996ed61acf66c3cb322da726a3f13 /source/blender
parent9d4fd2573531ea841ed0940b3babbe76da2e6d02 (diff)
parent57b5852bc8b8188e73e2ffd7c05aaa3f409c3025 (diff)
Merge branch 'blender2.7'
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface.c4
-rw-r--r--source/blender/editors/interface/interface_handlers.c6
-rw-r--r--source/blender/editors/interface/interface_intern.h2
3 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index f783c4a6906..1e079835ec5 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -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)))
{
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 498e2f07ea4..a52a9633729 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -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)
{
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 9d3f2088ab4..e5f6f09e2eb 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -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);