Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_layout.c
| Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | struct uiLayout { | ||||
| /** Sub layout to add child items, if not the layout itself. */ | /** Sub layout to add child items, if not the layout itself. */ | ||||
| uiLayout *child_items_layout; | uiLayout *child_items_layout; | ||||
| int x, y, w, h; | int x, y, w, h; | ||||
| float scale[2]; | float scale[2]; | ||||
| short space; | short space; | ||||
| bool align; | bool align; | ||||
| bool active; | bool active; | ||||
| bool activate_init; | |||||
| bool enabled; | bool enabled; | ||||
| bool redalert; | bool redalert; | ||||
| bool keepaspect; | bool keepaspect; | ||||
| /** For layouts inside gridflow, they and their items shall never have a fixed maximal size. */ | /** For layouts inside gridflow, they and their items shall never have a fixed maximal size. */ | ||||
| bool variable_size; | bool variable_size; | ||||
| char alignment; | char alignment; | ||||
| char emboss; | char emboss; | ||||
| /** for fixed width or height to avoid UI size changes */ | /** for fixed width or height to avoid UI size changes */ | ||||
| ▲ Show 20 Lines • Show All 1,655 Lines • ▼ Show 20 Lines | else { | ||||
| if (slider && but->type == UI_BTYPE_NUM) | if (slider && but->type == UI_BTYPE_NUM) | ||||
| but->type = UI_BTYPE_NUM_SLIDER; | but->type = UI_BTYPE_NUM_SLIDER; | ||||
| if (toggle && but->type == UI_BTYPE_CHECKBOX) | if (toggle && but->type == UI_BTYPE_CHECKBOX) | ||||
| but->type = UI_BTYPE_TOGGLE; | but->type = UI_BTYPE_TOGGLE; | ||||
| if (layout->redalert) | if (layout->redalert) | ||||
| UI_but_flag_enable(but, UI_BUT_REDALERT); | UI_but_flag_enable(but, UI_BUT_REDALERT); | ||||
| if (layout->activate_init) | |||||
| UI_but_flag_enable(but, UI_BUT_ACTIVATE_INIT); | |||||
| } | } | ||||
| /* Mark non-embossed textfields inside a listbox. */ | /* Mark non-embossed textfields inside a listbox. */ | ||||
| if (but && (block->flag & UI_BLOCK_LIST_ITEM) && (but->type == UI_BTYPE_TEXT) && (but->dt & UI_EMBOSS_NONE)) { | if (but && (block->flag & UI_BLOCK_LIST_ITEM) && (but->type == UI_BTYPE_TEXT) && (but->dt & UI_EMBOSS_NONE)) { | ||||
| UI_but_flag_enable(but, UI_BUT_LIST_ITEM); | UI_but_flag_enable(but, UI_BUT_LIST_ITEM); | ||||
| } | } | ||||
| #ifdef UI_PROP_DECORATE | #ifdef UI_PROP_DECORATE | ||||
| ▲ Show 20 Lines • Show All 2,102 Lines • ▼ Show 20 Lines | uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, bool align) | ||||
| return &split->litem; | return &split->litem; | ||||
| } | } | ||||
| void uiLayoutSetActive(uiLayout *layout, bool active) | void uiLayoutSetActive(uiLayout *layout, bool active) | ||||
| { | { | ||||
| layout->active = active; | layout->active = active; | ||||
| } | } | ||||
| void uiLayoutSetActivateInit(uiLayout *layout, bool activate_init) | |||||
| { | |||||
| layout->activate_init = activate_init; | |||||
| } | |||||
| void uiLayoutSetEnabled(uiLayout *layout, bool enabled) | void uiLayoutSetEnabled(uiLayout *layout, bool enabled) | ||||
| { | { | ||||
| layout->enabled = enabled; | layout->enabled = enabled; | ||||
| } | } | ||||
| void uiLayoutSetRedAlert(uiLayout *layout, bool redalert) | void uiLayoutSetRedAlert(uiLayout *layout, bool redalert) | ||||
| { | { | ||||
| layout->redalert = redalert; | layout->redalert = redalert; | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep) | ||||
| SET_FLAG_FROM_TEST(layout->item.flag, is_sep, UI_ITEM_PROP_DECORATE); | SET_FLAG_FROM_TEST(layout->item.flag, is_sep, UI_ITEM_PROP_DECORATE); | ||||
| } | } | ||||
| bool uiLayoutGetActive(uiLayout *layout) | bool uiLayoutGetActive(uiLayout *layout) | ||||
| { | { | ||||
| return layout->active; | return layout->active; | ||||
| } | } | ||||
| bool uiLayoutGetActivateInit(uiLayout *layout) | |||||
| { | |||||
| return layout->activate_init; | |||||
| } | |||||
| bool uiLayoutGetEnabled(uiLayout *layout) | bool uiLayoutGetEnabled(uiLayout *layout) | ||||
| { | { | ||||
| return layout->enabled; | return layout->enabled; | ||||
| } | } | ||||
| bool uiLayoutGetRedAlert(uiLayout *layout) | bool uiLayoutGetRedAlert(uiLayout *layout) | ||||
| { | { | ||||
| return layout->redalert; | return layout->redalert; | ||||
| ▲ Show 20 Lines • Show All 565 Lines • Show Last 20 Lines | |||||