diff options
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index ff752ddddba..2bdee577c74 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -299,7 +299,7 @@ static void ui_item_position(uiItem *item, int x, int y, int w, int h) bitem->but->rect.ymin = y; bitem->but->rect.xmax = x + w; bitem->but->rect.ymax = y + h; - + ui_but_update(bitem->but); /* for strlen */ } else { @@ -319,7 +319,7 @@ static void ui_item_move(uiItem *item, int delta_xmin, int delta_xmax) bitem->but->rect.xmin += delta_xmin; bitem->but->rect.xmax += delta_xmax; - + ui_but_update(bitem->but); /* for strlen */ } else { @@ -359,7 +359,7 @@ static uiLayout *ui_item_local_sublayout(uiLayout *test, uiLayout *layout, int a sub = uiLayoutRow(layout, align); else sub = uiLayoutColumn(layout, align); - + sub->space = 0; return sub; } @@ -429,9 +429,9 @@ static void ui_item_array( if (ptr->type == &RNA_Armature) { bArmature *arm = (bArmature *)ptr->data; - + layer_used = arm->layer_used; - + if (arm->edbo) { if (arm->act_edbone) { layer_active |= arm->act_edbone->layer; @@ -450,7 +450,7 @@ static void ui_item_array( for (a = 0; a < colbuts; a++) { const int layer_num = a + b * colbuts; const unsigned int layer_flag = (1u << layer_num); - + if (layer_used & layer_flag) { if (layer_active & layer_flag) icon = ICON_LAYER_ACTIVE; @@ -468,7 +468,7 @@ static void ui_item_array( for (a = 0; a < colbuts; a++) { const int layer_num = a + len / 2 + b * colbuts; const unsigned int layer_flag = (1u << layer_num); - + if (layer_used & layer_flag) { if (layer_active & layer_flag) icon = ICON_LAYER_ACTIVE; @@ -496,7 +496,7 @@ static void ui_item_array( totdim = RNA_property_array_dimension(ptr, prop, dim_size); if (totdim != 2) return; /* only 2D matrices supported in UI so far */ - + w /= dim_size[0]; /* h /= dim_size[1]; */ /* UNUSED */ @@ -1402,7 +1402,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index if (icon == ICON_NONE) icon = RNA_property_ui_icon(prop); - + if (flag & UI_ITEM_R_ICON_ONLY) { /* pass */ } @@ -1447,7 +1447,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index if (no_bg) UI_block_emboss_set(block, UI_EMBOSS_NONE); - + /* array property */ if (index == RNA_NO_INDEX && is_array) ui_item_array(layout, block, name, icon, ptr, prop, len, 0, 0, w, h, expand, slider, toggle, icon_only); @@ -1467,7 +1467,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index else if (type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) { but = ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, flag); ui_but_add_search(but, ptr, prop, NULL, NULL); - + if (layout->redalert) UI_but_flag_enable(but, UI_BUT_REDALERT); } @@ -1480,7 +1480,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index if (toggle && but->type == UI_BTYPE_CHECKBOX) but->type = UI_BTYPE_TOGGLE; - + if (layout->redalert) UI_but_flag_enable(but, UI_BUT_REDALERT); } @@ -1650,7 +1650,7 @@ static int sort_search_items_list(const void *a, const void *b) { const CollItemSearch *cis1 = a; const CollItemSearch *cis2 = b; - + if (BLI_strcasecmp(cis1->name, cis2->name) > 0) return 1; else @@ -1711,9 +1711,9 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s i++; } RNA_PROP_END; - + BLI_listbase_sort(items_list, sort_search_items_list); - + /* add search items from temporary list */ for (cis = items_list->first; cis; cis = cis->next) { if (false == UI_search_item_add(items, cis->name, SET_INT_IN_POINTER(cis->index), cis->iconid)) { @@ -1800,7 +1800,7 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna StructRNA *icontype; int w, h; char namestr[UI_MAX_NAME_STR]; - + /* validate arguments */ prop = RNA_struct_find_property(ptr, propname); @@ -1809,7 +1809,7 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna RNA_struct_identifier(ptr->type), propname); return; } - + type = RNA_property_type(prop); if (!ELEM(type, PROP_POINTER, PROP_STRING, PROP_ENUM)) { RNA_warning("Property %s must be a pointer, string or enum", propname); @@ -2214,7 +2214,7 @@ static void ui_litem_layout_row(uiLayout *litem) if (totw == 0) return; - + if (w != 0) w -= (tot - 1) * litem->space; fixedw = 0; @@ -2245,7 +2245,7 @@ static void ui_litem_layout_row(uiLayout *litem) /* ignore min flag for rows with right or center alignment */ if (item->type != ITEM_BUTTON && ELEM(((uiLayout *)item)->alignment, UI_LAYOUT_ALIGN_RIGHT, UI_LAYOUT_ALIGN_CENTER) && - litem->alignment == UI_LAYOUT_ALIGN_EXPAND && + litem->alignment == UI_LAYOUT_ALIGN_EXPAND && ((uiItem *)litem)->flag & UI_ITEM_MIN) { min_flag = false; @@ -2353,7 +2353,7 @@ static void ui_litem_estimate_column(uiLayout *litem, bool is_box) if (item->next && (!is_box || item != litem->items.first)) litem->h += litem->space; } - + if (min_size_flag) { litem->item.flag |= UI_ITEM_MIN; } @@ -2743,7 +2743,7 @@ static void ui_litem_layout_absolute(uiLayout *litem) scalex = (float)litem->w / (float)totw; if (litem->h && toth > 0) scaley = (float)litem->h / (float)toth; - + x = litem->x; y = litem->y - scaley * toth; @@ -2794,7 +2794,7 @@ static void ui_litem_layout_split(uiLayout *litem) y = litem->y; percentage = (split->percentage == 0.0f) ? 1.0f / (float)tot : split->percentage; - + w = (litem->w - (tot - 1) * litem->space); colw = w * percentage; colw = MAX2(colw, 0); @@ -3437,7 +3437,7 @@ uiLayout *UI_block_layout(uiBlock *block, int dir, int type, int x, int y, int s BLI_addtail(&block->layouts, root); ui_layout_add_padding_button(root); - + return layout; } @@ -3460,7 +3460,7 @@ void UI_block_layout_set_current(uiBlock *block, uiLayout *layout) void ui_layout_add_but(uiLayout *layout, uiBut *but) { uiButtonItem *bitem; - + bitem = MEM_callocN(sizeof(uiButtonItem), "uiButtonItem"); bitem->item.type = ITEM_BUTTON; bitem->but = but; |