UI Code Quality: Use LISTBASE_FOREACH in interface directory
I only skipped a few loops in the monstrous ui_handle_menu_event function. Also, I only changed variable names where necessary to prevent redeclarations. Differential Revision: https://developer.blender.org/D8586
This commit is contained in:
parent
ffa8e75799
commit
349eebd7d1
Notes:
blender-bot
2023-02-14 08:06:33 +01:00
Referenced by commit 5549ee2e08
, Fix incorrect number of recent items displayed in splash
|
@ -358,9 +358,7 @@ void ui_region_winrct_get_no_margin(const struct ARegion *region, struct rcti *r
|
|||
|
||||
void UI_block_translate(uiBlock *block, int x, int y)
|
||||
{
|
||||
uiBut *but;
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
BLI_rctf_translate(&but->rect, x, y);
|
||||
}
|
||||
|
||||
|
@ -370,12 +368,13 @@ void UI_block_translate(uiBlock *block, int x, int y)
|
|||
static void ui_block_bounds_calc_text(uiBlock *block, float offset)
|
||||
{
|
||||
const uiStyle *style = UI_style_get();
|
||||
uiBut *bt, *init_col_bt, *col_bt;
|
||||
uiBut *col_bt;
|
||||
int i = 0, j, x1addval = offset;
|
||||
|
||||
UI_fontstyle_set(&style->widget);
|
||||
|
||||
for (init_col_bt = bt = block->buttons.first; bt; bt = bt->next) {
|
||||
uiBut *init_col_bt = block->buttons.first;
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
if (!ELEM(bt->type, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE, UI_BTYPE_SEPR_SPACER)) {
|
||||
j = BLF_width(style->widget.uifont_id, bt->drawstr, sizeof(bt->drawstr));
|
||||
|
||||
|
@ -411,7 +410,6 @@ static void ui_block_bounds_calc_text(uiBlock *block, float offset)
|
|||
|
||||
void ui_block_bounds_calc(uiBlock *block)
|
||||
{
|
||||
uiBut *bt;
|
||||
int xof;
|
||||
|
||||
if (BLI_listbase_is_empty(&block->buttons)) {
|
||||
|
@ -426,7 +424,7 @@ void ui_block_bounds_calc(uiBlock *block)
|
|||
|
||||
BLI_rctf_init_minmax(&block->rect);
|
||||
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
BLI_rctf_union(&block->rect, &bt->rect);
|
||||
}
|
||||
|
||||
|
@ -439,7 +437,7 @@ void ui_block_bounds_calc(uiBlock *block)
|
|||
block->rect.xmax = block->rect.xmin + max_ff(BLI_rctf_size_x(&block->rect), block->minbounds);
|
||||
|
||||
/* hardcoded exception... but that one is annoying with larger safety */
|
||||
bt = block->buttons.first;
|
||||
uiBut *bt = block->buttons.first;
|
||||
if (bt && STREQLEN(bt->str, "ERROR", 5)) {
|
||||
xof = 10;
|
||||
}
|
||||
|
@ -701,9 +699,10 @@ static bool ui_but_equals_old(const uiBut *but, const uiBut *oldbut)
|
|||
|
||||
uiBut *ui_but_find_old(uiBlock *block_old, const uiBut *but_new)
|
||||
{
|
||||
uiBut *but_old;
|
||||
for (but_old = block_old->buttons.first; but_old; but_old = but_old->next) {
|
||||
if (ui_but_equals_old(but_new, but_old)) {
|
||||
uiBut *but_old = NULL;
|
||||
LISTBASE_FOREACH (uiBut *, but, &block_old->buttons) {
|
||||
if (ui_but_equals_old(but_new, but)) {
|
||||
but_old = but;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -711,9 +710,10 @@ uiBut *ui_but_find_old(uiBlock *block_old, const uiBut *but_new)
|
|||
}
|
||||
uiBut *ui_but_find_new(uiBlock *block_new, const uiBut *but_old)
|
||||
{
|
||||
uiBut *but_new;
|
||||
for (but_new = block_new->buttons.first; but_new; but_new = but_new->next) {
|
||||
if (ui_but_equals_old(but_new, but_old)) {
|
||||
uiBut *but_new = NULL;
|
||||
LISTBASE_FOREACH (uiBut *, but, &block_new->buttons) {
|
||||
if (ui_but_equals_old(but, but_old)) {
|
||||
but_new = but;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1465,7 +1465,6 @@ static void ui_but_pie_direction_string(uiBut *but, char *buf, int size)
|
|||
|
||||
static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
|
||||
{
|
||||
uiBut *but;
|
||||
char buf[128];
|
||||
|
||||
BLI_assert(block->flag & (UI_BLOCK_LOOP | UI_BLOCK_SHOW_SHORTCUT_ALWAYS));
|
||||
|
@ -1479,7 +1478,7 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
|
|||
}
|
||||
|
||||
if (block->flag & UI_BLOCK_RADIAL) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->pie_dir != UI_RADIAL_NONE) {
|
||||
ui_but_pie_direction_string(but, buf, sizeof(buf));
|
||||
ui_but_add_shortcut(but, buf, false);
|
||||
|
@ -1487,7 +1486,7 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
|
|||
}
|
||||
}
|
||||
else {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (block->flag & UI_BLOCK_SHOW_SHORTCUT_ALWAYS) {
|
||||
/* Skip icon-only buttons (as used in the toolbar). */
|
||||
if (but->drawstr[0] == '\0') {
|
||||
|
@ -1575,10 +1574,7 @@ static void ui_but_extra_operator_icon_free(uiButExtraOpIcon *extra_icon)
|
|||
|
||||
void ui_but_extra_operator_icons_free(uiBut *but)
|
||||
{
|
||||
|
||||
for (uiButExtraOpIcon *op_icon = but->extra_op_icons.first, *op_icon_next; op_icon;
|
||||
op_icon = op_icon_next) {
|
||||
op_icon_next = op_icon->next;
|
||||
LISTBASE_FOREACH_MUTABLE (uiButExtraOpIcon *, op_icon, &but->extra_op_icons) {
|
||||
ui_but_extra_operator_icon_free(op_icon);
|
||||
}
|
||||
BLI_listbase_clear(&but->extra_op_icons);
|
||||
|
@ -1710,7 +1706,6 @@ static void ui_but_predefined_extra_operator_icons_add(uiBut *but)
|
|||
void UI_block_update_from_old(const bContext *C, uiBlock *block)
|
||||
{
|
||||
uiBut *but_old;
|
||||
uiBut *but;
|
||||
|
||||
if (!block->oldblock) {
|
||||
return;
|
||||
|
@ -1722,7 +1717,7 @@ void UI_block_update_from_old(const bContext *C, uiBlock *block)
|
|||
UI_butstore_update(block);
|
||||
}
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (ui_but_update_from_old_block(C, block, &but, &but_old)) {
|
||||
ui_but_update(but);
|
||||
|
||||
|
@ -1747,7 +1742,6 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2], int r_x
|
|||
Scene *scene = CTX_data_scene(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
uiBut *but;
|
||||
|
||||
BLI_assert(block->active);
|
||||
|
||||
|
@ -1757,7 +1751,7 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2], int r_x
|
|||
* on matching buttons, we need this to make button event handling non
|
||||
* blocking, while still allowing buttons to be remade each redraw as it
|
||||
* is expected by blender code */
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
/* temp? Proper check for graying out */
|
||||
if (but->optype) {
|
||||
wmOperatorType *ot = but->optype;
|
||||
|
@ -1877,7 +1871,6 @@ void UI_block_draw(const bContext *C, uiBlock *block)
|
|||
{
|
||||
uiStyle style = *UI_style_get_dpi(); /* XXX pass on as arg */
|
||||
ARegion *region;
|
||||
uiBut *but;
|
||||
rcti rect;
|
||||
|
||||
/* get menu region or area region */
|
||||
|
@ -1942,7 +1935,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
|
|||
UI_widgetbase_draw_cache_begin();
|
||||
|
||||
/* widgets */
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (!(but->flag & (UI_HIDDEN | UI_SCROLLED))) {
|
||||
ui_but_to_pixelrect(&rect, region, block, but);
|
||||
|
||||
|
@ -2508,17 +2501,18 @@ int ui_but_string_get_max_length(uiBut *but)
|
|||
|
||||
uiBut *ui_but_drag_multi_edit_get(uiBut *but)
|
||||
{
|
||||
uiBut *but_iter;
|
||||
uiBut *return_but = NULL;
|
||||
|
||||
BLI_assert(but->flag & UI_BUT_DRAG_MULTI);
|
||||
|
||||
for (but_iter = but->block->buttons.first; but_iter; but_iter = but_iter->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but_iter, &but->block->buttons) {
|
||||
if (but_iter->editstr) {
|
||||
return_but = but_iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return but_iter;
|
||||
return return_but;
|
||||
}
|
||||
|
||||
static double ui_get_but_scale_unit(uiBut *but, double value)
|
||||
|
@ -3378,11 +3372,7 @@ void UI_blocklist_free(const bContext *C, ListBase *lb)
|
|||
|
||||
void UI_blocklist_free_inactive(const bContext *C, ListBase *lb)
|
||||
{
|
||||
uiBlock *block, *nextblock;
|
||||
|
||||
for (block = lb->first; block; block = nextblock) {
|
||||
nextblock = block->next;
|
||||
|
||||
LISTBASE_FOREACH_MUTABLE (uiBlock *, block, lb) {
|
||||
if (!block->handle) {
|
||||
if (!block->active) {
|
||||
BLI_remlink(lb, block);
|
||||
|
@ -5956,10 +5946,9 @@ uiBut *uiDefIconTextButO(uiBlock *block,
|
|||
|
||||
int UI_blocklist_min_y_get(ListBase *lb)
|
||||
{
|
||||
uiBlock *block;
|
||||
int min = 0;
|
||||
|
||||
for (block = lb->first; block; block = block->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, lb) {
|
||||
if (block == lb->first || block->rect.ymin < min) {
|
||||
min = block->rect.ymin;
|
||||
}
|
||||
|
@ -5976,7 +5965,6 @@ void UI_block_direction_set(uiBlock *block, char direction)
|
|||
/* this call escapes if there's alignment flags */
|
||||
void UI_block_order_flip(uiBlock *block)
|
||||
{
|
||||
uiBut *but;
|
||||
float centy, miny = 10000, maxy = -10000;
|
||||
|
||||
if (U.uiflag & USER_MENUFIXEDORDER) {
|
||||
|
@ -5986,7 +5974,7 @@ void UI_block_order_flip(uiBlock *block)
|
|||
return;
|
||||
}
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->drawflag & UI_BUT_ALIGN) {
|
||||
return;
|
||||
}
|
||||
|
@ -5999,7 +5987,7 @@ void UI_block_order_flip(uiBlock *block)
|
|||
}
|
||||
/* mirror trick */
|
||||
centy = (miny + maxy) / 2.0f;
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
but->rect.ymin = centy - (but->rect.ymin - centy);
|
||||
but->rect.ymax = centy - (but->rect.ymax - centy);
|
||||
SWAP(float, but->rect.ymin, but->rect.ymax);
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "DNA_screen_types.h"
|
||||
#include "DNA_userdef_types.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_rect.h"
|
||||
|
||||
|
@ -385,7 +386,6 @@ static void ui_block_align_but_to_region(uiBut *but, const ARegion *region)
|
|||
*/
|
||||
void ui_block_align_calc(uiBlock *block, const ARegion *region)
|
||||
{
|
||||
uiBut *but;
|
||||
int num_buttons = 0;
|
||||
|
||||
const int sides_to_ui_but_align_flags[4] = SIDE_TO_UI_BUT_ALIGN;
|
||||
|
@ -398,7 +398,7 @@ void ui_block_align_calc(uiBlock *block, const ARegion *region)
|
|||
/* First loop: we count number of buttons belonging to an align group,
|
||||
* and clear their align flag.
|
||||
* Tabs get some special treatment here, they get aligned to region border. */
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
/* special case: tabs need to be aligned to a region border, drawflag tells which one */
|
||||
if (but->type == UI_BTYPE_TAB) {
|
||||
ui_block_align_but_to_region(but, region);
|
||||
|
@ -431,7 +431,8 @@ void ui_block_align_calc(uiBlock *block, const ARegion *region)
|
|||
memset(butal_array, 0, sizeof(*butal_array) * (size_t)num_buttons);
|
||||
|
||||
/* Second loop: we initialize our ButAlign data for each button. */
|
||||
for (but = block->buttons.first, butal = butal_array; but; but = but->next) {
|
||||
butal = butal_array;
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->alignnr != 0) {
|
||||
butal->but = but;
|
||||
butal->borders[LEFT] = &but->rect.xmin;
|
||||
|
@ -726,11 +727,10 @@ static void ui_block_align_calc_but(uiBut *first, short nr)
|
|||
|
||||
void ui_block_align_calc(uiBlock *block, const struct ARegion *UNUSED(region))
|
||||
{
|
||||
uiBut *but;
|
||||
short nr;
|
||||
|
||||
/* align buttons with same align nr */
|
||||
for (but = block->buttons.first; but;) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->alignnr) {
|
||||
nr = but->alignnr;
|
||||
ui_block_align_calc_but(but, nr);
|
||||
|
|
|
@ -874,7 +874,7 @@ static void ui_apply_but_autokey(bContext *C, uiBut *but)
|
|||
|
||||
static void ui_apply_but_funcs_after(bContext *C)
|
||||
{
|
||||
uiAfterFunc *afterf, after;
|
||||
uiAfterFunc after;
|
||||
PointerRNA opptr;
|
||||
ListBase funcs;
|
||||
|
||||
|
@ -882,7 +882,7 @@ static void ui_apply_but_funcs_after(bContext *C)
|
|||
funcs = UIAfterFuncs;
|
||||
BLI_listbase_clear(&UIAfterFuncs);
|
||||
|
||||
for (afterf = funcs.first; afterf; afterf = after.next) {
|
||||
LISTBASE_FOREACH_MUTABLE (uiAfterFunc *, afterf, &funcs) {
|
||||
after = *afterf; /* copy to avoid memleak on exit() */
|
||||
BLI_freelinkN(&funcs, afterf);
|
||||
|
||||
|
@ -1009,14 +1009,12 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
|
|||
|
||||
static void ui_apply_but_ROW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
|
||||
{
|
||||
uiBut *bt;
|
||||
|
||||
ui_but_value_set(but, but->hardmax);
|
||||
|
||||
ui_apply_but_func(C, but);
|
||||
|
||||
/* states of other row buttons */
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
if (bt != but && bt->poin == but->poin && ELEM(bt->type, UI_BTYPE_ROW, UI_BTYPE_LISTROW)) {
|
||||
ui_but_update_edited(bt);
|
||||
}
|
||||
|
@ -1180,9 +1178,7 @@ static uiButMultiState *ui_multibut_lookup(uiHandleButtonData *data, const uiBut
|
|||
|
||||
static void ui_multibut_restore(bContext *C, uiHandleButtonData *data, uiBlock *block)
|
||||
{
|
||||
uiBut *but;
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->flag & UI_BUT_DRAG_MULTI) {
|
||||
uiButMultiState *mbut_state = ui_multibut_lookup(data, but);
|
||||
if (mbut_state) {
|
||||
|
@ -1235,7 +1231,6 @@ static bool ui_multibut_states_tag(uiBut *but_active,
|
|||
uiHandleButtonData *data,
|
||||
const wmEvent *event)
|
||||
{
|
||||
uiBut *but;
|
||||
float seg[2][2];
|
||||
bool changed = false;
|
||||
|
||||
|
@ -1253,7 +1248,7 @@ static bool ui_multibut_states_tag(uiBut *but_active,
|
|||
data->multi_data.has_mbuts = false;
|
||||
|
||||
/* follow ui_but_find_mouse_over_ex logic */
|
||||
for (but = but_active->block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &but_active->block->buttons) {
|
||||
bool drag_prev = false;
|
||||
bool drag_curr = false;
|
||||
|
||||
|
@ -1318,12 +1313,11 @@ static void ui_multibut_states_apply(bContext *C, uiHandleButtonData *data, uiBl
|
|||
const double value_delta = data->value - data->origvalue;
|
||||
const double value_scale = data->multi_data.is_proportional ? (data->value / data->origvalue) :
|
||||
0.0;
|
||||
uiBut *but;
|
||||
|
||||
BLI_assert(data->multi_data.init == BUTTON_MULTI_INIT_ENABLE);
|
||||
BLI_assert(data->multi_data.skip == false);
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->flag & UI_BUT_DRAG_MULTI) {
|
||||
/* mbut_states for delta */
|
||||
uiButMultiState *mbut_state = ui_multibut_lookup(data, but);
|
||||
|
@ -1447,18 +1441,15 @@ static bool ui_drag_toggle_set_xy_xy(
|
|||
/* popups such as layers won't re-evaluate on redraw */
|
||||
const bool do_check = (region->regiontype == RGN_TYPE_TEMPORARY);
|
||||
bool changed = false;
|
||||
uiBlock *block;
|
||||
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
uiBut *but;
|
||||
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
float xy_a_block[2] = {UNPACK2(xy_src)};
|
||||
float xy_b_block[2] = {UNPACK2(xy_dst)};
|
||||
|
||||
ui_window_to_block_fl(region, block, &xy_a_block[0], &xy_a_block[1]);
|
||||
ui_window_to_block_fl(region, block, &xy_b_block[0], &xy_b_block[1]);
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
/* Note: ctrl is always true here because (at least for now)
|
||||
* we always want to consider text control in this case, even when not embossed. */
|
||||
if (ui_but_is_interactive(but, true)) {
|
||||
|
@ -2246,10 +2237,9 @@ static void ui_apply_but(
|
|||
/* only call if event type is EVT_DROP */
|
||||
static void ui_but_drop(bContext *C, const wmEvent *event, uiBut *but, uiHandleButtonData *data)
|
||||
{
|
||||
wmDrag *wmd;
|
||||
ListBase *drags = event->customdata; /* drop event type has listbase customdata by default */
|
||||
|
||||
for (wmd = drags->first; wmd; wmd = wmd->next) {
|
||||
LISTBASE_FOREACH (wmDrag *, wmd, drags) {
|
||||
if (wmd->type == WM_DRAG_ID) {
|
||||
/* align these types with UI_but_active_drop_name */
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_SEARCH_MENU)) {
|
||||
|
@ -4178,7 +4168,7 @@ static uiButExtraOpIcon *ui_but_extra_operator_icon_mouse_over_get(uiBut *but,
|
|||
}
|
||||
|
||||
/* Inverse order, from right to left. */
|
||||
for (uiButExtraOpIcon *op_icon = but->extra_op_icons.last; op_icon; op_icon = op_icon->prev) {
|
||||
LISTBASE_FOREACH_BACKWARD (uiButExtraOpIcon *, op_icon, &but->extra_op_icons) {
|
||||
if ((x > (xmax - icon_size)) && x < xmax) {
|
||||
return op_icon;
|
||||
}
|
||||
|
@ -7777,15 +7767,13 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
|
|||
|
||||
static void ui_blocks_set_tooltips(ARegion *region, const bool enable)
|
||||
{
|
||||
uiBlock *block;
|
||||
|
||||
if (!region) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* we disabled buttons when when they were already shown, and
|
||||
* re-enable them on mouse move */
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
block->tooltipdisabled = !enable;
|
||||
}
|
||||
}
|
||||
|
@ -8164,7 +8152,6 @@ static void button_activate_exit(
|
|||
{
|
||||
wmWindow *win = data->window;
|
||||
uiBlock *block = but->block;
|
||||
uiBut *bt;
|
||||
|
||||
if (but->type == UI_BTYPE_GRIP) {
|
||||
WM_cursor_modal_restore(win);
|
||||
|
@ -8182,7 +8169,7 @@ static void button_activate_exit(
|
|||
|
||||
#ifdef USE_DRAG_MULTINUM
|
||||
if (data->multi_data.has_mbuts) {
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
if (bt->flag & UI_BUT_DRAG_MULTI) {
|
||||
bt->flag &= ~UI_BUT_DRAG_MULTI;
|
||||
|
||||
|
@ -8238,12 +8225,12 @@ static void button_activate_exit(
|
|||
}
|
||||
|
||||
/* disable tooltips until mousemove + last active flag */
|
||||
for (block = data->region->uiblocks.first; block; block = block->next) {
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block_iter, &data->region->uiblocks) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block_iter->buttons) {
|
||||
bt->flag &= ~UI_BUT_LAST_ACTIVE;
|
||||
}
|
||||
|
||||
block->tooltipdisabled = 1;
|
||||
block_iter->tooltipdisabled = 1;
|
||||
}
|
||||
|
||||
ui_blocks_set_tooltips(data->region, false);
|
||||
|
@ -8308,12 +8295,11 @@ static uiBut *ui_context_button_active(ARegion *region, bool (*but_check_cb)(uiB
|
|||
uiBut *but_found = NULL;
|
||||
|
||||
while (region) {
|
||||
uiBlock *block;
|
||||
uiBut *but, *activebut = NULL;
|
||||
uiBut *activebut = NULL;
|
||||
|
||||
/* find active button */
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->active) {
|
||||
activebut = but;
|
||||
}
|
||||
|
@ -8436,7 +8422,6 @@ void UI_context_active_but_clear(bContext *C, wmWindow *win, ARegion *region)
|
|||
wmOperator *UI_context_active_operator_get(const struct bContext *C)
|
||||
{
|
||||
ARegion *region_ctx = CTX_wm_region(C);
|
||||
uiBlock *block;
|
||||
|
||||
/* background mode */
|
||||
if (region_ctx == NULL) {
|
||||
|
@ -8444,7 +8429,7 @@ wmOperator *UI_context_active_operator_get(const struct bContext *C)
|
|||
}
|
||||
|
||||
/* scan active regions ui */
|
||||
for (block = region_ctx->uiblocks.first; block; block = block->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion_ctx->uiblocks) {
|
||||
if (block->ui_operator) {
|
||||
return block->ui_operator;
|
||||
}
|
||||
|
@ -8453,13 +8438,12 @@ wmOperator *UI_context_active_operator_get(const struct bContext *C)
|
|||
/* scan popups */
|
||||
{
|
||||
bScreen *screen = CTX_wm_screen(C);
|
||||
ARegion *region;
|
||||
|
||||
for (region = screen->regionbase.first; region; region = region->next) {
|
||||
LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) {
|
||||
if (region == region_ctx) {
|
||||
continue;
|
||||
}
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
if (block->ui_operator) {
|
||||
return block->ui_operator;
|
||||
}
|
||||
|
@ -8478,15 +8462,14 @@ void UI_context_update_anim_flag(const bContext *C)
|
|||
struct Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
|
||||
depsgraph, (scene) ? scene->r.cfra : 0.0f);
|
||||
uiBlock *block;
|
||||
uiBut *but, *activebut;
|
||||
uiBut *activebut;
|
||||
|
||||
while (region) {
|
||||
/* find active button */
|
||||
activebut = NULL;
|
||||
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
ui_but_anim_flag(but, &anim_eval_context);
|
||||
ui_but_override_flag(CTX_data_main(C), but);
|
||||
if (UI_but_is_decorator(but)) {
|
||||
|
@ -8529,11 +8512,8 @@ void UI_context_update_anim_flag(const bContext *C)
|
|||
|
||||
static uiBut *ui_but_find_open_event(ARegion *region, const wmEvent *event)
|
||||
{
|
||||
uiBlock *block;
|
||||
uiBut *but;
|
||||
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but == event->customdata) {
|
||||
return but;
|
||||
}
|
||||
|
@ -10289,10 +10269,8 @@ static int ui_but_pie_menu_apply(bContext *C,
|
|||
|
||||
static uiBut *ui_block_pie_dir_activate(uiBlock *block, const wmEvent *event, RadialDirection dir)
|
||||
{
|
||||
uiBut *but;
|
||||
|
||||
if ((block->flag & UI_BLOCK_NUMSELECT) && event->val == KM_PRESS) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->pie_dir == dir && !ELEM(but->type, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE)) {
|
||||
return but;
|
||||
}
|
||||
|
@ -10324,7 +10302,6 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
|
|||
{
|
||||
ARegion *region;
|
||||
uiBlock *block;
|
||||
uiBut *but;
|
||||
float event_xy[2];
|
||||
double duration;
|
||||
bool is_click_style;
|
||||
|
@ -10346,7 +10323,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
|
|||
is_click_style = (block->pie_data.flags & UI_PIE_CLICK_STYLE);
|
||||
|
||||
/* if there's an active modal button, don't check events or outside, except for search menu */
|
||||
but = ui_region_find_active_but(region);
|
||||
uiBut *but_active = ui_region_find_active_but(region);
|
||||
|
||||
if (menu->scrolltimer == NULL) {
|
||||
menu->scrolltimer = WM_event_add_timer(
|
||||
|
@ -10364,7 +10341,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
|
|||
/* Distance from initial point. */
|
||||
dist = ui_block_calc_pie_segment(block, event_xy);
|
||||
|
||||
if (but && button_modal_state(but->active->state)) {
|
||||
if (but_active && button_modal_state(but_active->active->state)) {
|
||||
retval = ui_handle_menu_button(C, event, menu);
|
||||
}
|
||||
else {
|
||||
|
@ -10386,7 +10363,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
|
|||
block->pie_data.flags |= UI_PIE_ANIMATION_FINISHED;
|
||||
}
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->pie_dir != UI_RADIAL_NONE) {
|
||||
float vec[2];
|
||||
float center[2];
|
||||
|
@ -10425,7 +10402,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
|
|||
}
|
||||
|
||||
if (len_sq < 1.0f) {
|
||||
but = ui_region_find_active_but(menu->region);
|
||||
uiBut *but = ui_region_find_active_but(menu->region);
|
||||
|
||||
if (but) {
|
||||
return ui_but_pie_menu_apply(C, menu, but, true);
|
||||
|
@ -10451,7 +10428,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
|
|||
block->pie_data.flags |= UI_PIE_CLICK_STYLE;
|
||||
}
|
||||
else {
|
||||
but = ui_region_find_active_but(menu->region);
|
||||
uiBut *but = ui_region_find_active_but(menu->region);
|
||||
|
||||
if (but && (U.pie_menu_confirm > 0) &&
|
||||
(dist >= U.dpi_fac * (U.pie_menu_threshold + U.pie_menu_confirm))) {
|
||||
|
@ -10536,7 +10513,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
|
|||
case EVT_ZKEY: {
|
||||
if ((event->val == KM_PRESS || event->val == KM_DBL_CLICK) &&
|
||||
!IS_EVENT_MOD(event, shift, ctrl, oskey)) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->menu_key == event->type) {
|
||||
ui_but_pie_button_activate(C, but, menu);
|
||||
}
|
||||
|
@ -10569,7 +10546,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
|
|||
ATTR_FALLTHROUGH;
|
||||
CASE_NUM_TO_DIR(9, UI_RADIAL_NE);
|
||||
{
|
||||
but = ui_block_pie_dir_activate(block, event, num_dir);
|
||||
uiBut *but = ui_block_pie_dir_activate(block, event, num_dir);
|
||||
retval = ui_but_pie_button_activate(C, but, menu);
|
||||
break;
|
||||
}
|
||||
|
@ -11033,26 +11010,28 @@ bool UI_textbutton_activate_rna(const bContext *C,
|
|||
const void *rna_poin_data,
|
||||
const char *rna_prop_id)
|
||||
{
|
||||
uiBlock *block;
|
||||
uiBut *but = NULL;
|
||||
uiBlock *block_text = NULL;
|
||||
uiBut *but_text = NULL;
|
||||
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->type == UI_BTYPE_TEXT) {
|
||||
if (but->rnaprop && but->rnapoin.data == rna_poin_data) {
|
||||
if (STREQ(RNA_property_identifier(but->rnaprop), rna_prop_id)) {
|
||||
block_text = block;
|
||||
but_text = but;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (but) {
|
||||
if (but_text) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (but) {
|
||||
UI_but_active_only(C, region, block, but);
|
||||
if (but_text) {
|
||||
UI_but_active_only(C, region, block_text, but_text);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -11061,23 +11040,25 @@ bool UI_textbutton_activate_rna(const bContext *C,
|
|||
bool UI_textbutton_activate_but(const bContext *C, uiBut *actbut)
|
||||
{
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
uiBlock *block;
|
||||
uiBut *but = NULL;
|
||||
uiBlock *block_text = NULL;
|
||||
uiBut *but_text = NULL;
|
||||
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but == actbut && but->type == UI_BTYPE_TEXT) {
|
||||
block_text = block;
|
||||
but_text = but;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (but) {
|
||||
if (but_text) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (but) {
|
||||
UI_but_active_only(C, region, block, but);
|
||||
if (but_text) {
|
||||
UI_but_active_only(C, region, block_text, but_text);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -453,7 +453,7 @@ static uiLayout *ui_item_local_sublayout(uiLayout *test, uiLayout *layout, bool
|
|||
static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
|
||||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
uiBut *but = arg_but, *cbut;
|
||||
uiBut *but = arg_but;
|
||||
PointerRNA *ptr = &but->rnapoin;
|
||||
PropertyRNA *prop = but->rnaprop;
|
||||
int i, index = POINTER_AS_INT(arg_index);
|
||||
|
@ -471,7 +471,7 @@ static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
|
|||
|
||||
RNA_property_update(C, ptr, prop);
|
||||
|
||||
for (cbut = but->block->buttons.first; cbut; cbut = cbut->next) {
|
||||
LISTBASE_FOREACH (uiBut *, cbut, &but->block->buttons) {
|
||||
ui_but_update(cbut);
|
||||
}
|
||||
}
|
||||
|
@ -1072,8 +1072,7 @@ void UI_context_active_but_prop_get_filebrowser(const bContext *C,
|
|||
bool *r_is_userdef)
|
||||
{
|
||||
ARegion *region = CTX_wm_menu(C) ? CTX_wm_menu(C) : CTX_wm_region(C);
|
||||
uiBlock *block;
|
||||
uiBut *but, *prevbut = NULL;
|
||||
uiBut *prevbut = NULL;
|
||||
|
||||
memset(r_ptr, 0, sizeof(*r_ptr));
|
||||
*r_prop = NULL;
|
||||
|
@ -1084,8 +1083,8 @@ void UI_context_active_but_prop_get_filebrowser(const bContext *C,
|
|||
return;
|
||||
}
|
||||
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but && but->rnapoin.data) {
|
||||
if (RNA_property_type(but->rnaprop) == PROP_STRING) {
|
||||
prevbut = but;
|
||||
|
@ -3515,14 +3514,13 @@ void uiItemTabsEnumR_prop(
|
|||
/* single-row layout */
|
||||
static void ui_litem_estimate_row(uiLayout *litem)
|
||||
{
|
||||
uiItem *item;
|
||||
int itemw, itemh;
|
||||
bool min_size_flag = true;
|
||||
|
||||
litem->w = 0;
|
||||
litem->h = 0;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
|
||||
min_size_flag = min_size_flag && (item->flag & UI_ITEM_FIXED_SIZE);
|
||||
|
@ -3547,7 +3545,7 @@ static int ui_litem_min_width(int itemw)
|
|||
|
||||
static void ui_litem_layout_row(uiLayout *litem)
|
||||
{
|
||||
uiItem *item, *last_free_item = NULL;
|
||||
uiItem *last_free_item = NULL;
|
||||
int x, y, w, tot, totw, neww, newtotw, itemw, minw, itemh, offset;
|
||||
int fixedw, freew, fixedx, freex, flag = 0, lastw = 0;
|
||||
float extra_pixel;
|
||||
|
@ -3558,7 +3556,7 @@ static void ui_litem_layout_row(uiLayout *litem)
|
|||
totw = 0;
|
||||
tot = 0;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
totw += itemw;
|
||||
tot++;
|
||||
|
@ -3581,7 +3579,7 @@ static void ui_litem_layout_row(uiLayout *litem)
|
|||
newtotw = totw;
|
||||
extra_pixel = 0.0f;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
if (item->flag & UI_ITEM_AUTO_FIXED_SIZE) {
|
||||
continue;
|
||||
}
|
||||
|
@ -3633,7 +3631,7 @@ static void ui_litem_layout_row(uiLayout *litem)
|
|||
extra_pixel = 0.0f;
|
||||
x = litem->x;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
minw = ui_litem_min_width(itemw);
|
||||
|
||||
|
@ -3682,7 +3680,7 @@ static void ui_litem_layout_row(uiLayout *litem)
|
|||
if (extra_pixel > 0 && litem->alignment == UI_LAYOUT_ALIGN_EXPAND && last_free_item &&
|
||||
last_item && last_item->flag & UI_ITEM_AUTO_FIXED_SIZE) {
|
||||
ui_item_move(last_free_item, 0, extra_pixel);
|
||||
for (item = last_free_item->next; item; item = item->next) {
|
||||
for (uiItem *item = last_free_item->next; item; item = item->next) {
|
||||
ui_item_move(item, extra_pixel, extra_pixel);
|
||||
}
|
||||
}
|
||||
|
@ -3696,14 +3694,13 @@ static void ui_litem_layout_row(uiLayout *litem)
|
|||
/* single-column layout */
|
||||
static void ui_litem_estimate_column(uiLayout *litem, bool is_box)
|
||||
{
|
||||
uiItem *item;
|
||||
int itemw, itemh;
|
||||
bool min_size_flag = true;
|
||||
|
||||
litem->w = 0;
|
||||
litem->h = 0;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
|
||||
min_size_flag = min_size_flag && (item->flag & UI_ITEM_FIXED_SIZE);
|
||||
|
@ -3723,13 +3720,12 @@ static void ui_litem_estimate_column(uiLayout *litem, bool is_box)
|
|||
|
||||
static void ui_litem_layout_column(uiLayout *litem, bool is_box)
|
||||
{
|
||||
uiItem *item;
|
||||
int itemh, x, y;
|
||||
|
||||
x = litem->x;
|
||||
y = litem->y;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, NULL, &itemh);
|
||||
|
||||
y -= itemh;
|
||||
|
@ -3789,7 +3785,6 @@ static bool ui_item_is_radial_drawable(uiButtonItem *bitem)
|
|||
|
||||
static void ui_litem_layout_radial(uiLayout *litem)
|
||||
{
|
||||
uiItem *item;
|
||||
int itemh, itemw, x, y;
|
||||
int itemnum = 0;
|
||||
int totitems = 0;
|
||||
|
@ -3807,7 +3802,7 @@ static void ui_litem_layout_radial(uiLayout *litem)
|
|||
int minx = x, miny = y, maxx = x, maxy = y;
|
||||
|
||||
/* first count total items */
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
totitems++;
|
||||
}
|
||||
|
||||
|
@ -3815,7 +3810,7 @@ static void ui_litem_layout_radial(uiLayout *litem)
|
|||
litem->root->block->pie_data.flags |= UI_PIE_DEGREES_RANGE_LARGE;
|
||||
}
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
/* not all button types are drawn in a radial menu, do filtering here */
|
||||
if (ui_item_is_radial_displayable(item)) {
|
||||
RadialDirection dir;
|
||||
|
@ -3965,14 +3960,13 @@ static void ui_litem_estimate_column_flow(uiLayout *litem)
|
|||
{
|
||||
const uiStyle *style = litem->root->style;
|
||||
uiLayoutItemFlow *flow = (uiLayoutItemFlow *)litem;
|
||||
uiItem *item;
|
||||
int col, x, y, emh, emy, miny, itemw, itemh, maxw = 0;
|
||||
int toth, totitem;
|
||||
|
||||
/* compute max needed width and total height */
|
||||
toth = 0;
|
||||
totitem = 0;
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
maxw = MAX2(maxw, itemw);
|
||||
toth += itemh;
|
||||
|
@ -4004,7 +3998,7 @@ static void ui_litem_estimate_column_flow(uiLayout *litem)
|
|||
|
||||
/* create column per column */
|
||||
col = 0;
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
|
||||
y -= itemh + style->buttonspacey;
|
||||
|
@ -4030,14 +4024,13 @@ static void ui_litem_layout_column_flow(uiLayout *litem)
|
|||
{
|
||||
const uiStyle *style = litem->root->style;
|
||||
uiLayoutItemFlow *flow = (uiLayoutItemFlow *)litem;
|
||||
uiItem *item;
|
||||
int col, x, y, w, emh, emy, miny, itemw, itemh;
|
||||
int toth, totitem;
|
||||
|
||||
/* compute max needed width and total height */
|
||||
toth = 0;
|
||||
totitem = 0;
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
toth += itemh;
|
||||
totitem++;
|
||||
|
@ -4055,7 +4048,7 @@ static void ui_litem_layout_column_flow(uiLayout *litem)
|
|||
/* create column per column */
|
||||
col = 0;
|
||||
w = (litem->w - (flow->totcol - 1) * style->columnspace) / flow->totcol;
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
|
||||
itemw = (litem->alignment == UI_LAYOUT_ALIGN_EXPAND) ? w : min_ii(w, itemw);
|
||||
|
@ -4121,9 +4114,6 @@ static void ui_litem_grid_flow_compute(ListBase *items,
|
|||
UILayoutGridFlowInput *parameters,
|
||||
UILayoutGridFlowOutput *results)
|
||||
{
|
||||
uiItem *item;
|
||||
int i;
|
||||
|
||||
float tot_w = 0.0f, tot_h = 0.0f;
|
||||
float global_avg_w = 0.0f, global_totweight_w = 0.0f;
|
||||
int global_max_h = 0;
|
||||
|
@ -4163,7 +4153,8 @@ static void ui_litem_grid_flow_compute(ListBase *items,
|
|||
memset(max_h, 0, sizeof(*max_h) * parameters->tot_rows);
|
||||
}
|
||||
|
||||
for (i = 0, item = items->first; item; item = item->next, i++) {
|
||||
int i = 0;
|
||||
LISTBASE_FOREACH (uiItem *, item, items) {
|
||||
int item_w, item_h;
|
||||
ui_item_size(item, &item_w, &item_h);
|
||||
|
||||
|
@ -4186,6 +4177,7 @@ static void ui_litem_grid_flow_compute(ListBase *items,
|
|||
if (results->tot_items) {
|
||||
(*results->tot_items)++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Finalize computing of column average sizes */
|
||||
|
@ -4394,10 +4386,8 @@ static void ui_litem_estimate_grid_flow(uiLayout *litem)
|
|||
|
||||
static void ui_litem_layout_grid_flow(uiLayout *litem)
|
||||
{
|
||||
int i;
|
||||
const uiStyle *style = litem->root->style;
|
||||
uiLayoutItemGridFlow *gflow = (uiLayoutItemGridFlow *)litem;
|
||||
uiItem *item;
|
||||
|
||||
if (gflow->tot_items == 0) {
|
||||
litem->w = litem->h = 0;
|
||||
|
@ -4436,7 +4426,8 @@ static void ui_litem_layout_grid_flow(uiLayout *litem)
|
|||
.heights_array = heights,
|
||||
}));
|
||||
|
||||
for (item = litem->items.first, i = 0; item; item = item->next, i++) {
|
||||
int i;
|
||||
LISTBASE_FOREACH_INDEX (uiItem *, item, &litem->items, i) {
|
||||
const int col = gflow->row_major ? i % gflow->tot_columns : i / gflow->tot_rows;
|
||||
const int row = gflow->row_major ? i / gflow->tot_columns : i % gflow->tot_rows;
|
||||
int item_w, item_h;
|
||||
|
@ -4459,7 +4450,6 @@ static void ui_litem_layout_grid_flow(uiLayout *litem)
|
|||
/* free layout */
|
||||
static void ui_litem_estimate_absolute(uiLayout *litem)
|
||||
{
|
||||
uiItem *item;
|
||||
int itemx, itemy, itemw, itemh, minx, miny;
|
||||
|
||||
minx = 1e6;
|
||||
|
@ -4467,7 +4457,7 @@ static void ui_litem_estimate_absolute(uiLayout *litem)
|
|||
litem->w = 0;
|
||||
litem->h = 0;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_offset(item, &itemx, &itemy);
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
|
||||
|
@ -4484,7 +4474,6 @@ static void ui_litem_estimate_absolute(uiLayout *litem)
|
|||
|
||||
static void ui_litem_layout_absolute(uiLayout *litem)
|
||||
{
|
||||
uiItem *item;
|
||||
float scalex = 1.0f, scaley = 1.0f;
|
||||
int x, y, newx, newy, itemx, itemy, itemh, itemw, minx, miny, totw, toth;
|
||||
|
||||
|
@ -4493,7 +4482,7 @@ static void ui_litem_layout_absolute(uiLayout *litem)
|
|||
totw = 0;
|
||||
toth = 0;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_offset(item, &itemx, &itemy);
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
|
||||
|
@ -4517,7 +4506,7 @@ static void ui_litem_layout_absolute(uiLayout *litem)
|
|||
x = litem->x;
|
||||
y = litem->y - scaley * toth;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_offset(item, &itemx, &itemy);
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
|
||||
|
@ -4552,7 +4541,6 @@ static void ui_litem_estimate_split(uiLayout *litem)
|
|||
static void ui_litem_layout_split(uiLayout *litem)
|
||||
{
|
||||
uiLayoutItemSplit *split = (uiLayoutItemSplit *)litem;
|
||||
uiItem *item;
|
||||
float percentage, extra_pixel = 0.0f;
|
||||
const int tot = BLI_listbase_count(&litem->items);
|
||||
int itemh, x, y, w, colw = 0;
|
||||
|
@ -4570,7 +4558,7 @@ static void ui_litem_layout_split(uiLayout *litem)
|
|||
colw = w * percentage;
|
||||
colw = MAX2(colw, 0);
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, NULL, &itemh);
|
||||
|
||||
ui_item_position(item, x, y - itemh, colw, itemh);
|
||||
|
@ -4595,13 +4583,12 @@ static void ui_litem_layout_split(uiLayout *litem)
|
|||
/* overlap layout */
|
||||
static void ui_litem_estimate_overlap(uiLayout *litem)
|
||||
{
|
||||
uiItem *item;
|
||||
int itemw, itemh;
|
||||
|
||||
litem->w = 0;
|
||||
litem->h = 0;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
|
||||
litem->w = MAX2(itemw, litem->w);
|
||||
|
@ -4611,13 +4598,12 @@ static void ui_litem_estimate_overlap(uiLayout *litem)
|
|||
|
||||
static void ui_litem_layout_overlap(uiLayout *litem)
|
||||
{
|
||||
uiItem *item;
|
||||
int itemw, itemh, x, y;
|
||||
|
||||
x = litem->x;
|
||||
y = litem->y;
|
||||
|
||||
for (item = litem->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &litem->items) {
|
||||
ui_item_size(item, &itemw, &itemh);
|
||||
ui_item_position(item, x, y - itemh, litem->w, itemh);
|
||||
|
||||
|
@ -4775,7 +4761,6 @@ static uiLayoutItemBx *ui_layout_box(uiLayout *layout, int type)
|
|||
uiLayout *uiLayoutRadial(uiLayout *layout)
|
||||
{
|
||||
uiLayout *litem;
|
||||
uiItem *item;
|
||||
|
||||
/* radial layouts are only valid for radial menus */
|
||||
if (layout->root->type != UI_LAYOUT_PIEMENU) {
|
||||
|
@ -4783,7 +4768,7 @@ uiLayout *uiLayoutRadial(uiLayout *layout)
|
|||
}
|
||||
|
||||
/* only one radial wheel per root layout is allowed, so check and return that, if it exists */
|
||||
for (item = layout->root->layout->items.first; item; item = item->next) {
|
||||
LISTBASE_FOREACH (uiItem *, item, &layout->root->layout->items) {
|
||||
litem = (uiLayout *)item;
|
||||
if (litem->item.type == ITEM_LAYOUT_RADIAL) {
|
||||
UI_block_layout_set_current(layout->root->block, litem);
|
||||
|
@ -4813,8 +4798,7 @@ uiLayout *uiLayoutBox(uiLayout *layout)
|
|||
*/
|
||||
void ui_layout_list_set_labels_active(uiLayout *layout)
|
||||
{
|
||||
uiButtonItem *bitem;
|
||||
for (bitem = layout->items.first; bitem; bitem = bitem->item.next) {
|
||||
LISTBASE_FOREACH (uiButtonItem *, bitem, &layout->items) {
|
||||
if (bitem->item.type != ITEM_BUTTON) {
|
||||
ui_layout_list_set_labels_active((uiLayout *)(&bitem->item));
|
||||
}
|
||||
|
@ -5055,10 +5039,9 @@ int uiLayoutGetEmboss(uiLayout *layout)
|
|||
|
||||
static void ui_item_scale(uiLayout *litem, const float scale[2])
|
||||
{
|
||||
uiItem *item;
|
||||
int x, y, w, h;
|
||||
|
||||
for (item = litem->items.last; item; item = item->prev) {
|
||||
LISTBASE_FOREACH_BACKWARD (uiItem *, item, &litem->items) {
|
||||
if (item->type != ITEM_BUTTON) {
|
||||
uiLayout *subitem = (uiLayout *)item;
|
||||
ui_item_scale(subitem, scale);
|
||||
|
@ -5083,12 +5066,10 @@ static void ui_item_scale(uiLayout *litem, const float scale[2])
|
|||
|
||||
static void ui_item_estimate(uiItem *item)
|
||||
{
|
||||
uiItem *subitem;
|
||||
|
||||
if (item->type != ITEM_BUTTON) {
|
||||
uiLayout *litem = (uiLayout *)item;
|
||||
|
||||
for (subitem = litem->items.first; subitem; subitem = subitem->next) {
|
||||
LISTBASE_FOREACH (uiItem *, subitem, &litem->items) {
|
||||
ui_item_estimate(subitem);
|
||||
}
|
||||
|
||||
|
@ -5146,11 +5127,10 @@ static void ui_item_estimate(uiItem *item)
|
|||
|
||||
static void ui_item_align(uiLayout *litem, short nr)
|
||||
{
|
||||
uiItem *item;
|
||||
uiButtonItem *bitem;
|
||||
uiLayoutItemBx *box;
|
||||
|
||||
for (item = litem->items.last; item; item = item->prev) {
|
||||
LISTBASE_FOREACH_BACKWARD (uiItem *, item, &litem->items) {
|
||||
if (item->type == ITEM_BUTTON) {
|
||||
bitem = (uiButtonItem *)item;
|
||||
#ifndef USE_UIBUT_SPATIAL_ALIGN
|
||||
|
@ -5182,10 +5162,9 @@ static void ui_item_align(uiLayout *litem, short nr)
|
|||
|
||||
static void ui_item_flag(uiLayout *litem, int flag)
|
||||
{
|
||||
uiItem *item;
|
||||
uiButtonItem *bitem;
|
||||
|
||||
for (item = litem->items.last; item; item = item->prev) {
|
||||
LISTBASE_FOREACH_BACKWARD (uiItem *, item, &litem->items) {
|
||||
if (item->type == ITEM_BUTTON) {
|
||||
bitem = (uiButtonItem *)item;
|
||||
bitem->but->flag |= flag;
|
||||
|
@ -5198,8 +5177,6 @@ static void ui_item_flag(uiLayout *litem, int flag)
|
|||
|
||||
static void ui_item_layout(uiItem *item)
|
||||
{
|
||||
uiItem *subitem;
|
||||
|
||||
if (item->type != ITEM_BUTTON) {
|
||||
uiLayout *litem = (uiLayout *)item;
|
||||
|
||||
|
@ -5252,7 +5229,7 @@ static void ui_item_layout(uiItem *item)
|
|||
break;
|
||||
}
|
||||
|
||||
for (subitem = litem->items.first; subitem; subitem = subitem->next) {
|
||||
LISTBASE_FOREACH (uiItem *, subitem, &litem->items) {
|
||||
if (item->flag & UI_ITEM_BOX_ITEM) {
|
||||
subitem->flag |= UI_ITEM_BOX_ITEM;
|
||||
}
|
||||
|
@ -5286,11 +5263,7 @@ static void ui_layout_end(uiBlock *block, uiLayout *layout, int *r_x, int *r_y)
|
|||
|
||||
static void ui_layout_free(uiLayout *layout)
|
||||
{
|
||||
uiItem *item, *next;
|
||||
|
||||
for (item = layout->items.first; item; item = next) {
|
||||
next = item->next;
|
||||
|
||||
LISTBASE_FOREACH_MUTABLE (uiItem *, item, &layout->items) {
|
||||
if (item->type == ITEM_BUTTON) {
|
||||
MEM_freeN(item);
|
||||
}
|
||||
|
@ -5474,8 +5447,6 @@ void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv)
|
|||
|
||||
void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
|
||||
{
|
||||
uiLayoutRoot *root;
|
||||
|
||||
BLI_assert(block->active);
|
||||
|
||||
if (r_x) {
|
||||
|
@ -5487,7 +5458,7 @@ void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
|
|||
|
||||
block->curlayout = NULL;
|
||||
|
||||
for (root = block->layouts.first; root; root = root->next) {
|
||||
LISTBASE_FOREACH (uiLayoutRoot *, root, &block->layouts) {
|
||||
ui_layout_add_padding_button(root);
|
||||
|
||||
/* NULL in advance so we don't interfere when adding button */
|
||||
|
|
|
@ -715,8 +715,7 @@ static void ui_context_selected_bones_via_pose(bContext *C, ListBase *r_lb)
|
|||
lb = CTX_data_collection_get(C, "selected_pose_bones");
|
||||
|
||||
if (!BLI_listbase_is_empty(&lb)) {
|
||||
CollectionPointerLink *link;
|
||||
for (link = lb.first; link; link = link->next) {
|
||||
LISTBASE_FOREACH (CollectionPointerLink *, link, &lb) {
|
||||
bPoseChannel *pchan = link->ptr.data;
|
||||
RNA_pointer_create(link->ptr.owner_id, &RNA_Bone, pchan->bone, &link->ptr);
|
||||
}
|
||||
|
@ -843,12 +842,10 @@ bool UI_context_copy_to_selected_list(bContext *C,
|
|||
|
||||
/* Now filter by type */
|
||||
if (node) {
|
||||
CollectionPointerLink *link, *link_next;
|
||||
lb = CTX_data_collection_get(C, "selected_nodes");
|
||||
|
||||
for (link = lb.first; link; link = link_next) {
|
||||
LISTBASE_FOREACH_MUTABLE (CollectionPointerLink *, link, &lb) {
|
||||
bNode *node_data = link->ptr.data;
|
||||
link_next = link->next;
|
||||
|
||||
if (node_data->type != node->type) {
|
||||
BLI_remlink(&lb, link);
|
||||
|
@ -876,9 +873,7 @@ bool UI_context_copy_to_selected_list(bContext *C,
|
|||
|
||||
/* de-duplicate obdata */
|
||||
if (!BLI_listbase_is_empty(&lb)) {
|
||||
CollectionPointerLink *link, *link_next;
|
||||
|
||||
for (link = lb.first; link; link = link->next) {
|
||||
LISTBASE_FOREACH (CollectionPointerLink *, link, &lb) {
|
||||
Object *ob = (Object *)link->ptr.owner_id;
|
||||
if (ob->data) {
|
||||
ID *id_data = ob->data;
|
||||
|
@ -886,10 +881,9 @@ bool UI_context_copy_to_selected_list(bContext *C,
|
|||
}
|
||||
}
|
||||
|
||||
for (link = lb.first; link; link = link_next) {
|
||||
LISTBASE_FOREACH_MUTABLE (CollectionPointerLink *, link, &lb) {
|
||||
Object *ob = (Object *)link->ptr.owner_id;
|
||||
ID *id_data = ob->data;
|
||||
link_next = link->next;
|
||||
|
||||
if ((id_data == NULL) || (id_data->tag & LIB_TAG_DOIT) == 0 || ID_IS_LINKED(id_data) ||
|
||||
(GS(id_data->name) != id_code)) {
|
||||
|
@ -970,12 +964,11 @@ static bool copy_to_selected_button(bContext *C, bool all, bool poll)
|
|||
if (ptr.data && prop) {
|
||||
char *path = NULL;
|
||||
bool use_path_from_id;
|
||||
CollectionPointerLink *link;
|
||||
ListBase lb = {NULL};
|
||||
|
||||
if (UI_context_copy_to_selected_list(C, &ptr, prop, &lb, &use_path_from_id, &path) &&
|
||||
!BLI_listbase_is_empty(&lb)) {
|
||||
for (link = lb.first; link; link = link->next) {
|
||||
LISTBASE_FOREACH (CollectionPointerLink *, link, &lb) {
|
||||
if (link->ptr.data != ptr.data) {
|
||||
if (use_path_from_id) {
|
||||
/* Path relative to ID. */
|
||||
|
@ -1299,13 +1292,14 @@ static int editsource_text_edit(bContext *C,
|
|||
const int line)
|
||||
{
|
||||
struct Main *bmain = CTX_data_main(C);
|
||||
Text *text;
|
||||
Text *text = NULL;
|
||||
|
||||
/* Developers may wish to copy-paste to an external editor. */
|
||||
printf("%s:%d\n", filepath, line);
|
||||
|
||||
for (text = bmain->texts.first; text; text = text->id.next) {
|
||||
if (text->filepath && BLI_path_cmp(text->filepath, filepath) == 0) {
|
||||
LISTBASE_FOREACH (Text *, text_iter, &bmain->texts) {
|
||||
if (text_iter->filepath && BLI_path_cmp(text_iter->filepath, filepath) == 0) {
|
||||
text = text_iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ uiBut *ui_but_find_mouse_over_ex(ARegion *region, const int x, const int y, cons
|
|||
float mx = x, my = y;
|
||||
ui_window_to_block_fl(region, block, &mx, &my);
|
||||
|
||||
for (uiBut *but = block->buttons.last; but; but = but->prev) {
|
||||
LISTBASE_FOREACH_BACKWARD (uiBut *, but, &block->buttons) {
|
||||
if (ui_but_is_interactive(but, labeledit)) {
|
||||
if (but->pie_dir != UI_RADIAL_NONE) {
|
||||
if (ui_but_isect_pie_seg(block, but)) {
|
||||
|
@ -324,7 +324,7 @@ uiBut *ui_but_find_rect_over(const struct ARegion *region, const rcti *rect_px)
|
|||
rctf rect_block;
|
||||
ui_window_to_block_rctf(region, block, &rect_block, &rect_px_fl);
|
||||
|
||||
for (uiBut *but = block->buttons.last; but; but = but->prev) {
|
||||
LISTBASE_FOREACH_BACKWARD (uiBut *, but, &block->buttons) {
|
||||
if (ui_but_is_interactive(but, labeledit)) {
|
||||
/* No pie menu support. */
|
||||
BLI_assert(but->pie_dir == UI_RADIAL_NONE);
|
||||
|
@ -354,7 +354,7 @@ uiBut *ui_list_find_mouse_over_ex(ARegion *region, int x, int y)
|
|||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
float mx = x, my = y;
|
||||
ui_window_to_block_fl(region, block, &mx, &my);
|
||||
for (uiBut *but = block->buttons.last; but; but = but->prev) {
|
||||
LISTBASE_FOREACH_BACKWARD (uiBut *, but, &block->buttons) {
|
||||
if (but->type == UI_BTYPE_LISTBOX && ui_but_contains_pt(but, mx, my)) {
|
||||
return but;
|
||||
}
|
||||
|
@ -399,14 +399,10 @@ uiBut *ui_but_next(uiBut *but)
|
|||
|
||||
uiBut *ui_but_first(uiBlock *block)
|
||||
{
|
||||
uiBut *but;
|
||||
|
||||
but = block->buttons.first;
|
||||
while (but) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (ui_but_is_editable(but)) {
|
||||
return but;
|
||||
}
|
||||
but = but->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -183,7 +183,6 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but,
|
|||
ColorPicker *cpicker,
|
||||
const float rgb[3])
|
||||
{
|
||||
uiBut *bt;
|
||||
float *hsv = cpicker->color_data;
|
||||
|
||||
/* Convert from RGB to HSV in perceptually linear space. */
|
||||
|
@ -196,7 +195,7 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but,
|
|||
|
||||
/* this updates button strings,
|
||||
* is hackish... but button pointers are on stack of caller function */
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
if (bt->custom_data != cpicker) {
|
||||
continue;
|
||||
}
|
||||
|
@ -849,9 +848,7 @@ static int ui_colorpicker_small_wheel_cb(const bContext *UNUSED(C),
|
|||
}
|
||||
|
||||
if (add != 0.0f) {
|
||||
uiBut *but;
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
if (but->type == UI_BTYPE_HSVCUBE && but->active == NULL) {
|
||||
uiPopupBlockHandle *popup = block->handle;
|
||||
float rgb[3];
|
||||
|
|
|
@ -130,9 +130,10 @@ static uiBut *ui_popup_menu_memory__internal(uiBlock *block, uiBut *but)
|
|||
}
|
||||
|
||||
/* get */
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
if (mem[hash_mod] == ui_popup_string_hash(but->str, but->flag & UI_BUT_HAS_SEP_CHAR)) {
|
||||
return but;
|
||||
LISTBASE_FOREACH (uiBut *, but_iter, &block->buttons) {
|
||||
if (mem[hash_mod] ==
|
||||
ui_popup_string_hash(but_iter->str, but_iter->flag & UI_BUT_HAS_SEP_CHAR)) {
|
||||
return but_iter;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,7 +233,6 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
|
|||
UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT);
|
||||
|
||||
if (pup->popup) {
|
||||
uiBut *bt;
|
||||
int offset[2];
|
||||
|
||||
uiBut *but_activate = NULL;
|
||||
|
@ -241,6 +241,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
|
|||
UI_block_direction_set(block, direction);
|
||||
|
||||
/* offset the mouse position, possibly based on earlier selection */
|
||||
uiBut *bt;
|
||||
if ((block->flag & UI_BLOCK_POPUP_MEMORY) && (bt = ui_popup_menu_memory_get(block))) {
|
||||
/* position mouse on last clicked item, at 0.8*width of the
|
||||
* button, so it doesn't overlap the text too much, also note
|
||||
|
@ -257,15 +258,16 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
|
|||
/* position mouse at 0.8*width of the button and below the tile
|
||||
* on the first item */
|
||||
offset[0] = 0;
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
offset[0] = min_ii(offset[0], -(bt->rect.xmin + 0.8f * BLI_rctf_size_x(&bt->rect)));
|
||||
LISTBASE_FOREACH (uiBut *, but_iter, &block->buttons) {
|
||||
offset[0] = min_ii(offset[0],
|
||||
-(but_iter->rect.xmin + 0.8f * BLI_rctf_size_x(&but_iter->rect)));
|
||||
}
|
||||
|
||||
offset[1] = 2.1 * UI_UNIT_Y;
|
||||
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
if (ui_but_is_editable(bt)) {
|
||||
but_activate = bt;
|
||||
LISTBASE_FOREACH (uiBut *, but_iter, &block->buttons) {
|
||||
if (ui_but_is_editable(but_iter)) {
|
||||
but_activate = but_iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -499,8 +501,6 @@ uiLayout *UI_popup_menu_layout(uiPopupMenu *pup)
|
|||
|
||||
void UI_popup_menu_reports(bContext *C, ReportList *reports)
|
||||
{
|
||||
Report *report;
|
||||
|
||||
uiPopupMenu *pup = NULL;
|
||||
uiLayout *layout;
|
||||
|
||||
|
@ -508,7 +508,7 @@ void UI_popup_menu_reports(bContext *C, ReportList *reports)
|
|||
return;
|
||||
}
|
||||
|
||||
for (report = reports->list.first; report; report = report->next) {
|
||||
LISTBASE_FOREACH (Report *, report, &reports->list) {
|
||||
int icon;
|
||||
const char *msg, *msg_next;
|
||||
|
||||
|
|
|
@ -203,11 +203,12 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, v
|
|||
if (!handle->refresh) {
|
||||
uiBut *but = NULL;
|
||||
uiBut *but_first = NULL;
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
if ((but_first == NULL) && ui_but_is_editable(but)) {
|
||||
but_first = but;
|
||||
LISTBASE_FOREACH (uiBut *, but_iter, &block->buttons) {
|
||||
if ((but_first == NULL) && ui_but_is_editable(but_iter)) {
|
||||
but_first = but_iter;
|
||||
}
|
||||
if (but->flag & (UI_SELECT | UI_SELECT_DRAW)) {
|
||||
if (but_iter->flag & (UI_SELECT | UI_SELECT_DRAW)) {
|
||||
but = but_iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,8 +59,6 @@
|
|||
*/
|
||||
void ui_popup_translate(ARegion *region, const int mdiff[2])
|
||||
{
|
||||
uiBlock *block;
|
||||
|
||||
BLI_rcti_translate(®ion->winrct, UNPACK2(mdiff));
|
||||
|
||||
ED_region_update_rect(region);
|
||||
|
@ -68,13 +66,12 @@ void ui_popup_translate(ARegion *region, const int mdiff[2])
|
|||
ED_region_tag_redraw(region);
|
||||
|
||||
/* update blocks */
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
uiPopupBlockHandle *handle = block->handle;
|
||||
/* Make empty, will be initialized on next use, see T60608. */
|
||||
BLI_rctf_init(&handle->prev_block_rect, 0, 0, 0, 0);
|
||||
|
||||
uiSafetyRct *saferct;
|
||||
for (saferct = block->saferct.first; saferct; saferct = saferct->next) {
|
||||
LISTBASE_FOREACH (uiSafetyRct *, saferct, &block->saferct) {
|
||||
BLI_rctf_translate(&saferct->parent, UNPACK2(mdiff));
|
||||
BLI_rctf_translate(&saferct->safety, UNPACK2(mdiff));
|
||||
}
|
||||
|
@ -373,16 +370,13 @@ static void ui_block_region_refresh(const bContext *C, ARegion *region)
|
|||
{
|
||||
ScrArea *ctx_area = CTX_wm_area(C);
|
||||
ARegion *ctx_region = CTX_wm_region(C);
|
||||
uiBlock *block;
|
||||
|
||||
if (region->do_draw & RGN_REFRESH_UI) {
|
||||
ScrArea *handle_ctx_area;
|
||||
ARegion *handle_ctx_region;
|
||||
uiBlock *block_next;
|
||||
|
||||
region->do_draw &= ~RGN_REFRESH_UI;
|
||||
for (block = region->uiblocks.first; block; block = block_next) {
|
||||
block_next = block->next;
|
||||
LISTBASE_FOREACH_MUTABLE (uiBlock *, block, ®ion->uiblocks) {
|
||||
uiPopupBlockHandle *handle = block->handle;
|
||||
|
||||
if (handle->can_refresh) {
|
||||
|
@ -409,9 +403,7 @@ static void ui_block_region_refresh(const bContext *C, ARegion *region)
|
|||
|
||||
static void ui_block_region_draw(const bContext *C, ARegion *region)
|
||||
{
|
||||
uiBlock *block;
|
||||
|
||||
for (block = region->uiblocks.first; block; block = block->next) {
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
UI_block_draw(C, block);
|
||||
}
|
||||
}
|
||||
|
@ -441,7 +433,6 @@ static void ui_block_region_popup_window_listener(wmWindow *UNUSED(win),
|
|||
|
||||
static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
|
||||
{
|
||||
uiBut *bt;
|
||||
const float xmin_orig = block->rect.xmin;
|
||||
const int margin = UI_SCREEN_MARGIN;
|
||||
int winx, winy;
|
||||
|
@ -475,7 +466,7 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
|
|||
|
||||
/* ensure menu items draw inside left/right boundary */
|
||||
const float xofs = block->rect.xmin - xmin_orig;
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
bt->rect.xmin += xofs;
|
||||
bt->rect.xmax += xofs;
|
||||
}
|
||||
|
@ -483,11 +474,9 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
|
|||
|
||||
void ui_popup_block_scrolltest(uiBlock *block)
|
||||
{
|
||||
uiBut *bt;
|
||||
|
||||
block->flag &= ~(UI_BLOCK_CLIPBOTTOM | UI_BLOCK_CLIPTOP);
|
||||
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
bt->flag &= ~UI_SCROLLED;
|
||||
}
|
||||
|
||||
|
@ -496,7 +485,7 @@ void ui_popup_block_scrolltest(uiBlock *block)
|
|||
}
|
||||
|
||||
/* mark buttons that are outside boundary */
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
if (bt->rect.ymin < block->rect.ymin) {
|
||||
bt->flag |= UI_SCROLLED;
|
||||
block->flag |= UI_BLOCK_CLIPBOTTOM;
|
||||
|
@ -508,7 +497,7 @@ void ui_popup_block_scrolltest(uiBlock *block)
|
|||
}
|
||||
|
||||
/* mark buttons overlapping arrows, if we have them */
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
LISTBASE_FOREACH (uiBut *, bt, &block->buttons) {
|
||||
if (block->flag & UI_BLOCK_CLIPBOTTOM) {
|
||||
if (bt->rect.ymin < block->rect.ymin + UI_MENU_SCROLL_ARROW) {
|
||||
bt->flag |= UI_SCROLLED;
|
||||
|
@ -535,9 +524,10 @@ static void ui_popup_block_remove(bContext *C, uiPopupBlockHandle *handle)
|
|||
/* There may actually be a different window active than the one showing the popup, so lookup real
|
||||
* one. */
|
||||
if (BLI_findindex(&screen->regionbase, handle->region) == -1) {
|
||||
for (win = wm->windows.first; win; win = win->next) {
|
||||
screen = WM_window_get_active_screen(win);
|
||||
LISTBASE_FOREACH (wmWindow *, win_iter, &wm->windows) {
|
||||
screen = WM_window_get_active_screen(win_iter);
|
||||
if (BLI_findindex(&screen->regionbase, handle->region) != -1) {
|
||||
win = win_iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -426,7 +426,6 @@ int UI_fontstyle_height_max(const uiFontStyle *fs)
|
|||
/* reading without uifont will create one */
|
||||
void uiStyleInit(void)
|
||||
{
|
||||
uiFont *font;
|
||||
uiStyle *style = U.uistyles.first;
|
||||
|
||||
/* recover from uninitialized dpi */
|
||||
|
@ -435,7 +434,7 @@ void uiStyleInit(void)
|
|||
}
|
||||
CLAMP(U.dpi, 48, 144);
|
||||
|
||||
for (font = U.uifonts.first; font; font = font->next) {
|
||||
LISTBASE_FOREACH (uiFont *, font, &U.uifonts) {
|
||||
BLF_unload_id(font->blf_id);
|
||||
}
|
||||
|
||||
|
@ -449,24 +448,24 @@ void uiStyleInit(void)
|
|||
blf_mono_font_render = -1;
|
||||
}
|
||||
|
||||
font = U.uifonts.first;
|
||||
uiFont *font_first = U.uifonts.first;
|
||||
|
||||
/* default builtin */
|
||||
if (font == NULL) {
|
||||
font = MEM_callocN(sizeof(uiFont), "ui font");
|
||||
BLI_addtail(&U.uifonts, font);
|
||||
if (font_first == NULL) {
|
||||
font_first = MEM_callocN(sizeof(uiFont), "ui font");
|
||||
BLI_addtail(&U.uifonts, font_first);
|
||||
}
|
||||
|
||||
if (U.font_path_ui[0]) {
|
||||
BLI_strncpy(font->filename, U.font_path_ui, sizeof(font->filename));
|
||||
font->uifont_id = UIFONT_CUSTOM1;
|
||||
BLI_strncpy(font_first->filename, U.font_path_ui, sizeof(font_first->filename));
|
||||
font_first->uifont_id = UIFONT_CUSTOM1;
|
||||
}
|
||||
else {
|
||||
BLI_strncpy(font->filename, "default", sizeof(font->filename));
|
||||
font->uifont_id = UIFONT_DEFAULT;
|
||||
BLI_strncpy(font_first->filename, "default", sizeof(font_first->filename));
|
||||
font_first->uifont_id = UIFONT_DEFAULT;
|
||||
}
|
||||
|
||||
for (font = U.uifonts.first; font; font = font->next) {
|
||||
LISTBASE_FOREACH (uiFont *, font, &U.uifonts) {
|
||||
const bool unique = false;
|
||||
|
||||
if (font->uifont_id == UIFONT_DEFAULT) {
|
||||
|
@ -535,7 +534,7 @@ void uiStyleInit(void)
|
|||
flag_enable |= BLF_MONOCHROME;
|
||||
}
|
||||
|
||||
for (font = U.uifonts.first; font; font = font->next) {
|
||||
LISTBASE_FOREACH (uiFont *, font, &U.uifonts) {
|
||||
if (font->blf_id != -1) {
|
||||
BLF_disable(font->blf_id, flag_disable);
|
||||
BLF_enable(font->blf_id, flag_enable);
|
||||
|
|
|
@ -395,11 +395,10 @@ static void id_search_cb(const bContext *C,
|
|||
{
|
||||
TemplateID *template_ui = (TemplateID *)arg_template;
|
||||
ListBase *lb = template_ui->idlb;
|
||||
ID *id;
|
||||
int flag = RNA_property_flag(template_ui->prop);
|
||||
|
||||
/* ID listbase */
|
||||
for (id = lb->first; id; id = id->next) {
|
||||
LISTBASE_FOREACH (ID *, id, lb) {
|
||||
if (!id_search_add(C, template_ui, flag, str, items, id)) {
|
||||
break;
|
||||
}
|
||||
|
@ -416,11 +415,10 @@ static void id_search_cb_tagged(const bContext *C,
|
|||
{
|
||||
TemplateID *template_ui = (TemplateID *)arg_template;
|
||||
ListBase *lb = template_ui->idlb;
|
||||
ID *id;
|
||||
int flag = RNA_property_flag(template_ui->prop);
|
||||
|
||||
/* ID listbase */
|
||||
for (id = lb->first; id; id = id->next) {
|
||||
LISTBASE_FOREACH (ID *, id, lb) {
|
||||
if (id->tag & LIB_TAG_DOIT) {
|
||||
if (!id_search_add(C, template_ui, flag, str, items, id)) {
|
||||
break;
|
||||
|
@ -2420,9 +2418,8 @@ static eAutoPropButsReturn template_operator_property_buts_draw_single(
|
|||
/* Only do this if we're not refreshing an existing UI. */
|
||||
if (block->oldblock == NULL) {
|
||||
const bool is_popup = (block->flag & UI_BLOCK_KEEP_OPEN) != 0;
|
||||
uiBut *but;
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
/* no undo for buttons for operator redo panels */
|
||||
UI_but_flag_disable(but, UI_BUT_UNDO);
|
||||
|
||||
|
@ -5415,7 +5412,6 @@ void uiTemplatePalette(uiLayout *layout,
|
|||
PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
|
||||
PointerRNA cptr;
|
||||
Palette *palette;
|
||||
PaletteColor *color;
|
||||
uiBlock *block;
|
||||
uiLayout *col;
|
||||
uiBut *but = NULL;
|
||||
|
@ -5437,8 +5433,6 @@ void uiTemplatePalette(uiLayout *layout,
|
|||
|
||||
palette = cptr.data;
|
||||
|
||||
color = palette->colors.first;
|
||||
|
||||
col = uiLayoutColumn(layout, true);
|
||||
uiLayoutRow(col, true);
|
||||
uiDefIconButO(block,
|
||||
|
@ -5461,7 +5455,7 @@ void uiTemplatePalette(uiLayout *layout,
|
|||
UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
NULL);
|
||||
if (color) {
|
||||
if (palette->colors.first != NULL) {
|
||||
but = uiDefIconButO(block,
|
||||
UI_BTYPE_BUT,
|
||||
"PALETTE_OT_color_move",
|
||||
|
@ -5496,7 +5490,7 @@ void uiTemplatePalette(uiLayout *layout,
|
|||
col = uiLayoutColumn(layout, true);
|
||||
uiLayoutRow(col, true);
|
||||
|
||||
for (; color; color = color->next) {
|
||||
LISTBASE_FOREACH (PaletteColor *, color, &palette->colors) {
|
||||
PointerRNA color_ptr;
|
||||
|
||||
if (row_cols >= cols_per_row) {
|
||||
|
@ -6650,9 +6644,8 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
|
|||
|
||||
UI_block_func_handle_set(block, do_running_jobs, NULL);
|
||||
|
||||
Scene *scene;
|
||||
/* another scene can be rendering too, for example via compositor */
|
||||
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
|
||||
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
|
||||
if (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY)) {
|
||||
handle_event = B_STOPOTHER;
|
||||
icon = ICON_NONE;
|
||||
|
@ -7366,10 +7359,8 @@ void uiTemplateCacheFile(uiLayout *layout,
|
|||
|
||||
int uiTemplateRecentFiles(uiLayout *layout, int rows)
|
||||
{
|
||||
const RecentFile *recent;
|
||||
int i;
|
||||
|
||||
for (recent = G.recent_files.first, i = 0; (i < rows) && (recent); recent = recent->next, i++) {
|
||||
LISTBASE_FOREACH_INDEX (RecentFile *, recent, &G.recent_files, i) {
|
||||
const char *filename = BLI_path_basename(recent->filepath);
|
||||
PointerRNA ptr;
|
||||
uiItemFullO(layout,
|
||||
|
@ -7382,6 +7373,10 @@ int uiTemplateRecentFiles(uiLayout *layout, int rows)
|
|||
&ptr);
|
||||
RNA_string_set(&ptr, "filepath", recent->filepath);
|
||||
RNA_boolean_set(&ptr, "display_file_selector", false);
|
||||
|
||||
if (i > rows) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
|
|
|
@ -714,12 +714,8 @@ bool UI_butstore_is_valid(uiButStore *bs)
|
|||
|
||||
bool UI_butstore_is_registered(uiBlock *block, uiBut *but)
|
||||
{
|
||||
uiButStore *bs_handle;
|
||||
|
||||
for (bs_handle = block->butstore.first; bs_handle; bs_handle = bs_handle->next) {
|
||||
uiButStoreElem *bs_elem;
|
||||
|
||||
for (bs_elem = bs_handle->items.first; bs_elem; bs_elem = bs_elem->next) {
|
||||
LISTBASE_FOREACH (uiButStore *, bs_handle, &block->butstore) {
|
||||
LISTBASE_FOREACH (uiButStoreElem *, bs_elem, &bs_handle->items) {
|
||||
if (*bs_elem->but_p == but) {
|
||||
return true;
|
||||
}
|
||||
|
@ -740,10 +736,7 @@ void UI_butstore_register(uiButStore *bs_handle, uiBut **but_p)
|
|||
|
||||
void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p)
|
||||
{
|
||||
uiButStoreElem *bs_elem, *bs_elem_next;
|
||||
|
||||
for (bs_elem = bs_handle->items.first; bs_elem; bs_elem = bs_elem_next) {
|
||||
bs_elem_next = bs_elem->next;
|
||||
LISTBASE_FOREACH_MUTABLE (uiButStoreElem *, bs_elem, &bs_handle->items) {
|
||||
if (bs_elem->but_p == but_p) {
|
||||
BLI_remlink(&bs_handle->items, bs_elem);
|
||||
MEM_freeN(bs_elem);
|
||||
|
@ -758,12 +751,10 @@ void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p)
|
|||
*/
|
||||
bool UI_butstore_register_update(uiBlock *block, uiBut *but_dst, const uiBut *but_src)
|
||||
{
|
||||
uiButStore *bs_handle;
|
||||
bool found = false;
|
||||
|
||||
for (bs_handle = block->butstore.first; bs_handle; bs_handle = bs_handle->next) {
|
||||
uiButStoreElem *bs_elem;
|
||||
for (bs_elem = bs_handle->items.first; bs_elem; bs_elem = bs_elem->next) {
|
||||
LISTBASE_FOREACH (uiButStore *, bs_handle, &block->butstore) {
|
||||
LISTBASE_FOREACH (uiButStoreElem *, bs_elem, &bs_handle->items) {
|
||||
if (*bs_elem->but_p == but_src) {
|
||||
*bs_elem->but_p = but_dst;
|
||||
found = true;
|
||||
|
@ -779,14 +770,9 @@ bool UI_butstore_register_update(uiBlock *block, uiBut *but_dst, const uiBut *bu
|
|||
*/
|
||||
void UI_butstore_clear(uiBlock *block)
|
||||
{
|
||||
uiButStore *bs_handle;
|
||||
|
||||
for (bs_handle = block->butstore.first; bs_handle; bs_handle = bs_handle->next) {
|
||||
uiButStoreElem *bs_elem;
|
||||
|
||||
LISTBASE_FOREACH (uiButStore *, bs_handle, &block->butstore) {
|
||||
bs_handle->block = NULL;
|
||||
|
||||
for (bs_elem = bs_handle->items.first; bs_elem; bs_elem = bs_elem->next) {
|
||||
LISTBASE_FOREACH (uiButStoreElem *, bs_elem, &bs_handle->items) {
|
||||
*bs_elem->but_p = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -797,8 +783,6 @@ void UI_butstore_clear(uiBlock *block)
|
|||
*/
|
||||
void UI_butstore_update(uiBlock *block)
|
||||
{
|
||||
uiButStore *bs_handle;
|
||||
|
||||
/* move this list to the new block */
|
||||
if (block->oldblock) {
|
||||
if (block->oldblock->butstore.first) {
|
||||
|
@ -812,17 +796,14 @@ void UI_butstore_update(uiBlock *block)
|
|||
|
||||
/* warning, loop-in-loop, in practice we only store <10 buttons at a time,
|
||||
* so this isn't going to be a problem, if that changes old-new mapping can be cached first */
|
||||
for (bs_handle = block->butstore.first; bs_handle; bs_handle = bs_handle->next) {
|
||||
|
||||
LISTBASE_FOREACH (uiButStore *, bs_handle, &block->butstore) {
|
||||
BLI_assert((bs_handle->block == NULL) || (bs_handle->block == block) ||
|
||||
(block->oldblock && block->oldblock == bs_handle->block));
|
||||
|
||||
if (bs_handle->block == block->oldblock) {
|
||||
uiButStoreElem *bs_elem;
|
||||
|
||||
bs_handle->block = block;
|
||||
|
||||
for (bs_elem = bs_handle->items.first; bs_elem; bs_elem = bs_elem->next) {
|
||||
LISTBASE_FOREACH (uiButStoreElem *, bs_elem, &bs_handle->items) {
|
||||
if (*bs_elem->but_p) {
|
||||
uiBut *but_new = ui_but_find_new(block, *bs_elem->but_p);
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "DNA_brush_types.h"
|
||||
#include "DNA_userdef_types.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_rect.h"
|
||||
#include "BLI_string.h"
|
||||
|
@ -2242,7 +2243,7 @@ static void widget_draw_extra_icons(const uiWidgetColors *wcol,
|
|||
float alpha)
|
||||
{
|
||||
/* inverse order, from right to left. */
|
||||
for (uiButExtraOpIcon *op_icon = but->extra_op_icons.last; op_icon; op_icon = op_icon->prev) {
|
||||
LISTBASE_FOREACH_BACKWARD (uiButExtraOpIcon *, op_icon, &but->extra_op_icons) {
|
||||
rcti temp = *rect;
|
||||
|
||||
temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f);
|
||||
|
|
|
@ -870,8 +870,6 @@ void UI_view2d_curRect_changed(const bContext *C, View2D *v2d)
|
|||
* to make sure 'related' views stay in synchrony */
|
||||
void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
|
||||
{
|
||||
ARegion *region;
|
||||
|
||||
/* don't continue if no view syncing to be done */
|
||||
if ((v2dcur->flag & (V2D_VIEWSYNC_SCREEN_TIME | V2D_VIEWSYNC_AREA_VERTICAL)) == 0) {
|
||||
return;
|
||||
|
@ -879,7 +877,7 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
|
|||
|
||||
/* check if doing within area syncing (i.e. channels/vertical) */
|
||||
if ((v2dcur->flag & V2D_VIEWSYNC_AREA_VERTICAL) && (area)) {
|
||||
for (region = area->regionbase.first; region; region = region->next) {
|
||||
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||
/* don't operate on self */
|
||||
if (v2dcur != ®ion->v2d) {
|
||||
/* only if view has vertical locks enabled */
|
||||
|
@ -905,7 +903,7 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
|
|||
/* check if doing whole screen syncing (i.e. time/horizontal) */
|
||||
if ((v2dcur->flag & V2D_VIEWSYNC_SCREEN_TIME) && (screen)) {
|
||||
LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) {
|
||||
for (region = area_iter->regionbase.first; region; region = region->next) {
|
||||
LISTBASE_FOREACH (ARegion *, region, &area_iter->regionbase) {
|
||||
/* don't operate on self */
|
||||
if (v2dcur != ®ion->v2d) {
|
||||
/* only if view has horizontal locks enabled */
|
||||
|
|
Loading…
Reference in New Issue