Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_layout.c
| Show First 20 Lines • Show All 3,743 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (uiItem *, item, &litem->items) { | ||||
| } | } | ||||
| } | } | ||||
| if (min_size_flag) { | if (min_size_flag) { | ||||
| litem->item.flag |= UI_ITEM_FIXED_SIZE; | litem->item.flag |= UI_ITEM_FIXED_SIZE; | ||||
| } | } | ||||
| } | } | ||||
| static void ui_litem_layout_column(uiLayout *litem, bool is_box) | static void ui_litem_layout_column(uiLayout *litem, bool is_box, bool is_menu) | ||||
| { | { | ||||
| int itemh, x, y; | int itemw, itemh, x, y; | ||||
| x = litem->x; | x = litem->x; | ||||
| y = litem->y; | y = litem->y; | ||||
| LISTBASE_FOREACH (uiItem *, item, &litem->items) { | LISTBASE_FOREACH (uiItem *, item, &litem->items) { | ||||
| ui_item_size(item, NULL, &itemh); | ui_item_size(item, &itemw, &itemh); | ||||
| y -= itemh; | y -= itemh; | ||||
| ui_item_position(item, x, y, litem->w, itemh); | ui_item_position(item, x, y, is_menu ? itemw : litem->w, itemh); | ||||
| if (item->next && (!is_box || item != litem->items.first)) { | if (item->next && (!is_box || item != litem->items.first)) { | ||||
| y -= litem->space; | y -= litem->space; | ||||
| } | } | ||||
| if (is_box) { | if (is_box) { | ||||
| item->flag |= UI_ITEM_BOX_ITEM; | item->flag |= UI_ITEM_BOX_ITEM; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
| static void ui_litem_layout_root(uiLayout *litem) | static void ui_litem_layout_root(uiLayout *litem) | ||||
| { | { | ||||
| if (litem->root->type == UI_LAYOUT_HEADER) { | if (litem->root->type == UI_LAYOUT_HEADER) { | ||||
| ui_litem_layout_row(litem); | ui_litem_layout_row(litem); | ||||
| } | } | ||||
| else if (litem->root->type == UI_LAYOUT_PIEMENU) { | else if (litem->root->type == UI_LAYOUT_PIEMENU) { | ||||
| ui_litem_layout_root_radial(litem); | ui_litem_layout_root_radial(litem); | ||||
| } | } | ||||
| else if (litem->root->type == UI_LAYOUT_MENU) { | |||||
| ui_litem_layout_column(litem, false, true); | |||||
| } | |||||
| else { | else { | ||||
| ui_litem_layout_column(litem, false); | ui_litem_layout_column(litem, false, false); | ||||
| } | } | ||||
| } | } | ||||
| /* box layout */ | /* box layout */ | ||||
| static void ui_litem_estimate_box(uiLayout *litem) | static void ui_litem_estimate_box(uiLayout *litem) | ||||
| { | { | ||||
| const uiStyle *style = litem->root->style; | const uiStyle *style = litem->root->style; | ||||
| Show All 27 Lines | static void ui_litem_layout_box(uiLayout *litem) | ||||
| if (w != 0) { | if (w != 0) { | ||||
| litem->w -= 2 * boxspace; | litem->w -= 2 * boxspace; | ||||
| } | } | ||||
| if (h != 0) { | if (h != 0) { | ||||
| litem->h -= 2 * boxspace; | litem->h -= 2 * boxspace; | ||||
| } | } | ||||
| ui_litem_layout_column(litem, true); | ui_litem_layout_column(litem, true, false); | ||||
| litem->x -= boxspace; | litem->x -= boxspace; | ||||
| litem->y -= boxspace; | litem->y -= boxspace; | ||||
| if (w != 0) { | if (w != 0) { | ||||
| litem->w += 2 * boxspace; | litem->w += 2 * boxspace; | ||||
| } | } | ||||
| if (h != 0) { | if (h != 0) { | ||||
| ▲ Show 20 Lines • Show All 1,244 Lines • ▼ Show 20 Lines | if (!litem->active) { | ||||
| ui_item_flag(litem, UI_BUT_INACTIVE); | ui_item_flag(litem, UI_BUT_INACTIVE); | ||||
| } | } | ||||
| if (!litem->enabled) { | if (!litem->enabled) { | ||||
| ui_item_flag(litem, UI_BUT_DISABLED); | ui_item_flag(litem, UI_BUT_DISABLED); | ||||
| } | } | ||||
| switch (litem->item.type) { | switch (litem->item.type) { | ||||
| case ITEM_LAYOUT_COLUMN: | case ITEM_LAYOUT_COLUMN: | ||||
| ui_litem_layout_column(litem, false); | ui_litem_layout_column(litem, false, false); | ||||
| break; | break; | ||||
| case ITEM_LAYOUT_COLUMN_FLOW: | case ITEM_LAYOUT_COLUMN_FLOW: | ||||
| ui_litem_layout_column_flow(litem); | ui_litem_layout_column_flow(litem); | ||||
| break; | break; | ||||
| case ITEM_LAYOUT_GRID_FLOW: | case ITEM_LAYOUT_GRID_FLOW: | ||||
| ui_litem_layout_grid_flow(litem); | ui_litem_layout_grid_flow(litem); | ||||
| break; | break; | ||||
| case ITEM_LAYOUT_ROW: | case ITEM_LAYOUT_ROW: | ||||
| ▲ Show 20 Lines • Show All 564 Lines • Show Last 20 Lines | |||||