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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-05-13 02:58:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-05-13 03:01:13 +0300
commit898b6491ed979ab5a59af25f5fb06841e8df59e5 (patch)
treec6c003cc683113f63fbd54c05472aab908811e84 /source
parent91ec8d8d1ebbcfb00fa6eb711513a98238903d70 (diff)
UI: multi-value-edit, tint button while editing
Currently re-uses node-flag (which is only used to tint color too)
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_handlers.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 8e3cc08feee..036e2ba9911 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -185,12 +185,17 @@ typedef struct uiSelectContextStore {
static bool ui_selectcontext_begin(
bContext *C, uiBut *but, struct uiSelectContextStore *selctx_data);
+static void ui_selectcontext_end(
+ uiBut *but, uiSelectContextStore *selctx_data);
static void ui_selectcontext_apply(
bContext *C, uiBut *but, struct uiSelectContextStore *selctx_data,
const double value, const double value_orig);
#define IS_ALLSELECT_EVENT(event) ((event)->alt != 0)
+/* just show a tinted color so users know its activated */
+#define UI_BUT_IS_SELECT_CONTEXT UI_BUT_NODE_ACTIVE
+
#endif /* USE_ALLSELECT */
@@ -1426,9 +1431,25 @@ finally:
/* caller can clear */
selctx_data->do_free = true;
+ if (success) {
+ but->flag |= UI_BUT_IS_SELECT_CONTEXT;
+ }
+
return success;
}
+static void ui_selectcontext_end(
+ uiBut *but, uiSelectContextStore *selctx_data)
+{
+ if (selctx_data->do_free) {
+ if (selctx_data->elems) {
+ MEM_freeN(selctx_data->elems);
+ }
+ }
+
+ but->flag &= ~UI_BUT_IS_SELECT_CONTEXT;
+}
+
static void ui_selectcontext_apply(
bContext *C, uiBut *but, uiSelectContextStore *selctx_data,
const double value, const double value_orig)
@@ -7606,11 +7627,7 @@ static void button_activate_exit(
MEM_freeN(data->origstr);
#ifdef USE_ALLSELECT
- if (data->select_others.do_free) {
- if (data->select_others.elems) {
- MEM_freeN(data->select_others.elems);
- }
- }
+ ui_selectcontext_end(but, &data->select_others);
#endif
/* redraw (data is but->active!) */