Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/area.c
| Show First 20 Lines • Show All 2,563 Lines • ▼ Show 20 Lines | static void ed_panel_draw(const bContext *C, | ||||
| int w, | int w, | ||||
| int em, | int em, | ||||
| char *unique_panel_str) | char *unique_panel_str) | ||||
| { | { | ||||
| const uiStyle *style = UI_style_get_dpi(); | const uiStyle *style = UI_style_get_dpi(); | ||||
| /* Draw panel. */ | /* Draw panel. */ | ||||
| char block_name[BKE_ST_MAXNAME + LIST_PANEL_UNIQUE_STR_LEN]; | char block_name[BKE_ST_MAXNAME + INSTANCED_PANEL_UNIQUE_STR_LEN]; | ||||
| strncpy(block_name, pt->idname, BKE_ST_MAXNAME); | strncpy(block_name, pt->idname, BKE_ST_MAXNAME); | ||||
| if (unique_panel_str != NULL) { | if (unique_panel_str != NULL) { | ||||
| /* Instanced panels should have already been added at this point. */ | /* Instanced panels should have already been added at this point. */ | ||||
| strncat(block_name, unique_panel_str, LIST_PANEL_UNIQUE_STR_LEN); | strncat(block_name, unique_panel_str, INSTANCED_PANEL_UNIQUE_STR_LEN); | ||||
| } | } | ||||
| uiBlock *block = UI_block_begin(C, region, block_name, UI_EMBOSS); | uiBlock *block = UI_block_begin(C, region, block_name, UI_EMBOSS); | ||||
| bool open; | bool open; | ||||
| panel = UI_panel_begin(region, lb, block, pt, panel, &open); | panel = UI_panel_begin(region, lb, block, pt, panel, &open); | ||||
| /* bad fixed values */ | /* bad fixed values */ | ||||
| int xco, yco, h = 0; | int xco, yco, h = 0; | ||||
| ▲ Show 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { | ||||
| if (panel && UI_panel_is_dragging(panel)) { | if (panel && UI_panel_is_dragging(panel)) { | ||||
| /* Prevent View2d.tot rectangle size changes while dragging panels. */ | /* Prevent View2d.tot rectangle size changes while dragging panels. */ | ||||
| update_tot_size = false; | update_tot_size = false; | ||||
| } | } | ||||
| /* Use a unique identifier for instanced panels, otherwise an old block for a different | /* Use a unique identifier for instanced panels, otherwise an old block for a different | ||||
| * panel of the same type might be found. */ | * panel of the same type might be found. */ | ||||
| char unique_panel_str[8]; | char unique_panel_str[INSTANCED_PANEL_UNIQUE_STR_LEN]; | ||||
| UI_list_panel_unique_str(panel, unique_panel_str); | UI_list_panel_unique_str(panel, unique_panel_str); | ||||
| ed_panel_draw(C, | ed_panel_draw(C, | ||||
| region, | region, | ||||
| ®ion->panels, | ®ion->panels, | ||||
| panel->type, | panel->type, | ||||
| panel, | panel, | ||||
| (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w, | (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w, | ||||
| em, | em, | ||||
| ▲ Show 20 Lines • Show All 984 Lines • Show Last 20 Lines | |||||