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:
authorJulian Eisel <julian@blender.org>2021-01-13 17:08:09 +0300
committerJulian Eisel <julian@blender.org>2021-01-13 17:31:02 +0300
commit2771dfd5632ad6d982ee4bf3e87decdb197ebed7 (patch)
tree515ef4f88aaf9ad2a3873ba9dec5133317703d18 /source/blender/editors/interface/interface_handlers.c
parentad4202a14fbce95b7c40df0e815c1ac261515b05 (diff)
UI: Revert design changes to data-block selector for the 2.92 release
Partially reverts 2250b5cefee7. Removing the user count and fake user count icons was controversial (which was expected) and there are a few further changes needed, that won't make it in time for the release, see D9946. While there is a design to bring back the user count and fake user indicators, a new design idea was proposed that the UI team wants to follow. This came too late for the 2.92 release, the new design is targeted at the 2.93 release now. Meanwhile, UI team decision was to simply revert the design changes. The new design is being worked on in https://developer.blender.org/T84669. Note that this commit does not revert some internal changes done in 2250b5cefee7. Namely the introduction of `ed_util_ops.c` and data-block operators in there. These will still be needed in the new design.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c51
1 files changed, 11 insertions, 40 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index c098b5c79a1..377e55e7299 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -334,7 +334,6 @@ typedef struct uiHandleButtonData {
int retval;
/* booleans (could be made into flags) */
bool cancel, escapecancel;
- bool skip_undo_push;
bool applied, applied_interactive;
bool changed_cursor;
wmTimer *flashtimer;
@@ -821,9 +820,7 @@ static void ui_apply_but_func(bContext *C, uiBut *but)
/* typically call ui_apply_but_undo(), ui_apply_but_autokey() */
static void ui_apply_but_undo(uiBut *but)
{
- const bool force_skip_undo = (but->active && but->active->skip_undo_push);
-
- if (but->flag & UI_BUT_UNDO && !force_skip_undo) {
+ if (but->flag & UI_BUT_UNDO) {
const char *str = NULL;
size_t str_len_clip = SIZE_MAX - 1;
bool skip_undo = false;
@@ -2874,8 +2871,7 @@ void ui_but_active_string_clear_and_exit(bContext *C, uiBut *but)
but->active->str[0] = 0;
ui_apply_but_TEX(C, but, but->active);
- /* use onfree event so undo is handled by caller and apply is already done above */
- button_activate_exit((bContext *)C, but, but->active, false, true);
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
}
static void ui_textedit_string_ensure_max_length(uiBut *but, uiHandleButtonData *data, int maxlen)
@@ -4020,38 +4016,16 @@ static void ui_numedit_apply(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
ED_region_tag_redraw(data->region);
}
-static void ui_but_extra_operator_icon_apply_func(uiBut *but, uiButExtraOpIcon *op_icon)
+static void ui_but_extra_operator_icon_apply(bContext *C, uiBut *but, uiButExtraOpIcon *op_icon)
{
- if (ui_afterfunc_check(but->block, but)) {
- uiAfterFunc *after = ui_afterfunc_new();
-
- after->optype = op_icon->optype_params->optype;
- after->opcontext = op_icon->optype_params->opcontext;
- after->opptr = op_icon->optype_params->opptr;
-
- if (but->context) {
- after->context = CTX_store_copy(but->context);
- }
-
- /* Ownership moved, don't let the UI code free it. */
- op_icon->optype_params->opptr = NULL;
+ if (but->active->interactive) {
+ ui_apply_but(C, but->block, but, but->active, true);
}
-}
-
-static void ui_but_extra_operator_icon_apply(bContext *C,
- uiBut *but,
- uiHandleButtonData *data,
- uiButExtraOpIcon *op_icon)
-{
button_activate_state(C, but, BUTTON_STATE_EXIT);
- ui_apply_but(C, but->block, but, data, true);
-
- data->postbut = but;
- data->posttype = BUTTON_ACTIVATE_OVER;
- /* Leave undo up to the operator. */
- data->skip_undo_push = true;
-
- ui_but_extra_operator_icon_apply_func(but, op_icon);
+ WM_operator_name_call_ptr(C,
+ op_icon->optype_params->optype,
+ op_icon->optype_params->opcontext,
+ op_icon->optype_params->opptr);
/* Force recreation of extra operator icons (pseudo update). */
ui_but_extra_operator_icons_free(but);
@@ -4250,7 +4224,7 @@ static bool ui_do_but_extra_operator_icon(bContext *C,
ED_region_tag_redraw(data->region);
button_tooltip_timer_reset(C, but);
- ui_but_extra_operator_icon_apply(C, but, data, op_icon);
+ ui_but_extra_operator_icon_apply(C, but, op_icon);
/* Note: 'but', 'data' may now be freed, don't access. */
return true;
@@ -7885,10 +7859,7 @@ static ARegion *ui_but_tooltip_init(
uiBut *but = UI_region_active_but_get(region);
*r_exit_on_event = false;
if (but) {
- uiButExtraOpIcon *extra_icon = ui_but_extra_operator_icon_mouse_over_get(
- but, but->active, CTX_wm_window(C)->eventstate);
-
- return UI_tooltip_create_from_button_or_extra_icon(C, region, but, extra_icon, is_label);
+ return UI_tooltip_create_from_button(C, region, but, is_label);
}
return NULL;
}