diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-09-19 02:49:17 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-09-19 02:49:17 +0300 |
commit | 976e591e93dd97de2c8f5be639a78c22e6505bae (patch) | |
tree | 12bcc68b21c2e049ed433c80c3016851fcd67064 /source | |
parent | 404a427dfdee0f5300b7c4f375cd7ff4a0b8bc8e (diff) |
Cleanup: Completely replace/remove uiBut.lock
Old leftover from pre 2.5 days. Now handled through UI_BUT_DISABLED button flag.
Diffstat (limited to 'source')
5 files changed, 5 insertions, 14 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index cbe8654ceb6..6d4c8f0ab98 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1247,7 +1247,6 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2]) if (ot == NULL || WM_operator_poll_context((bContext *)C, ot, but->opcontext) == 0) { but->flag |= UI_BUT_DISABLED; - but->lock = true; } if (but->context) @@ -3122,7 +3121,6 @@ static uiBut *ui_def_but( but->a2 = a2; but->tip = tip; - but->lock = block->lock; but->lockstr = block->lockstr; but->dt = block->dt; but->pie_dir = UI_RADIAL_NONE; @@ -3171,10 +3169,8 @@ static uiBut *ui_def_but( but->drawflag |= (block->flag & UI_BUT_ALIGN); - if (but->lock == true) { - if (but->lockstr) { - but->flag |= UI_BUT_DISABLED; - } + if (block->lock == true) { + but->flag |= UI_BUT_DISABLED; } /* keep track of UI_interface.h */ @@ -3222,7 +3218,6 @@ void ui_def_but_icon(uiBut *but, const int icon, const int flag) static void ui_def_but_rna__disable(uiBut *but) { but->flag |= UI_BUT_DISABLED; - but->lock = true; but->lockstr = ""; } @@ -3548,7 +3543,6 @@ static uiBut *ui_def_but_operator_ptr(uiBlock *block, int type, wmOperatorType * if (!ot) { but->flag |= UI_BUT_DISABLED; - but->lock = true; but->lockstr = ""; } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 4972e16bf2e..5e9fc53de16 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2248,7 +2248,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data, bool buf_paste_alloc = false; bool show_report = false; /* use to display errors parsing paste input */ - if (mode == 'v' && but->lock == true) { + if (mode == 'v' && (but->flag & UI_BUT_DISABLED)) { return; } @@ -7100,8 +7100,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * /* verify if we can edit this button */ if (ELEM(event->type, LEFTMOUSE, RETKEY)) { - /* this should become disabled button .. */ - if (but->lock == true) { + if (but->flag & UI_BUT_DISABLED) { if (but->lockstr) { WM_report(RPT_INFO, but->lockstr); button_activate_state(C, but, BUTTON_STATE_EXIT); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 8336efa381b..c274210e52a 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -274,7 +274,6 @@ struct uiBut { const char *lockstr; BIFIconID icon; - bool lock; char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied from the block */ signed char pie_dir; /* direction in a pie menu, used for collision detection (RadialDirection) */ char changed; /* could be made into a single flag */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index e802cf82b8e..672bd74745d 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -745,7 +745,6 @@ static void ui_item_disabled(uiLayout *layout, const char *name) but = uiDefBut(block, UI_BTYPE_LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); but->flag |= UI_BUT_DISABLED; - but->lock = true; but->lockstr = ""; } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 7a506c5c451..8073fb3552f 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -456,7 +456,7 @@ static uiTooltipData *ui_tooltip_data_from_button(bContext *C, uiBut *but) } /* button is disabled, we may be able to tell user why */ - if ((but->flag & UI_BUT_DISABLED) || but->lock) { + if (but->flag & UI_BUT_DISABLED) { const char *disabled_msg = NULL; /* if operator poll check failed, it can give pretty precise info why */ |