Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_panel.cc
| Show First 20 Lines • Show All 1,175 Lines • ▼ Show 20 Lines | static void panel_draw_aligned_backdrop(const Panel *panel, | ||||
| if (is_subpanel && !is_open) { | if (is_subpanel && !is_open) { | ||||
| return; | return; | ||||
| } | } | ||||
| const bTheme *btheme = UI_GetTheme(); | const bTheme *btheme = UI_GetTheme(); | ||||
| const float aspect = panel->runtime.block->aspect; | const float aspect = panel->runtime.block->aspect; | ||||
| const float radius = btheme->tui.panel_roundness * U.widget_unit * 0.5f / aspect; | const float radius = btheme->tui.panel_roundness * U.widget_unit * 0.5f / aspect; | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| /* Panel backdrop. */ | /* Panel backdrop. */ | ||||
| if (is_open || panel->type->flag & PANEL_TYPE_NO_HEADER) { | if (is_open || panel->type->flag & PANEL_TYPE_NO_HEADER) { | ||||
| float panel_backcolor[4]; | float panel_backcolor[4]; | ||||
| UI_draw_roundbox_corner_set(is_open ? UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT : UI_CNR_ALL); | UI_draw_roundbox_corner_set(is_open ? UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT : UI_CNR_ALL); | ||||
| UI_GetThemeColor4fv((is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK), panel_backcolor); | UI_GetThemeColor4fv((is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK), panel_backcolor); | ||||
| ▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | if (y_ofs > BLI_rcti_size_y(&v2d->mask)) { | ||||
| do_scaletabs = true; | do_scaletabs = true; | ||||
| } | } | ||||
| /* Begin drawing. */ | /* Begin drawing. */ | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| uint pos = GPU_vertformat_attr_add( | uint pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| /* Draw the background. */ | /* Draw the background. */ | ||||
| if (is_alpha) { | if (is_alpha) { | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| immUniformColor4ubv(theme_col_tab_bg); | immUniformColor4ubv(theme_col_tab_bg); | ||||
| } | } | ||||
| else { | else { | ||||
| immUniformColor3ubv(theme_col_tab_bg); | immUniformColor3ubv(theme_col_tab_bg); | ||||
| Show All 28 Lines | #endif | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| #ifdef USE_FLAT_INACTIVE | #ifdef USE_FLAT_INACTIVE | ||||
| /* Draw line between inactive tabs. */ | /* Draw line between inactive tabs. */ | ||||
| if (is_active == false && is_active_prev == false && pc_dyn->prev) { | if (is_active == false && is_active_prev == false && pc_dyn->prev) { | ||||
| pos = GPU_vertformat_attr_add( | pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformColor3fvAlpha(theme_col_tab_outline, 0.3f); | immUniformColor3fvAlpha(theme_col_tab_outline, 0.3f); | ||||
| immRecti(pos, | immRecti(pos, | ||||
| is_left ? v2d->mask.xmin + (category_tabs_width / 5) : | is_left ? v2d->mask.xmin + (category_tabs_width / 5) : | ||||
| v2d->mask.xmax - (category_tabs_width / 5), | v2d->mask.xmax - (category_tabs_width / 5), | ||||
| rct->ymax + px, | rct->ymax + px, | ||||
| is_left ? (v2d->mask.xmin + category_tabs_width) - (category_tabs_width / 5) : | is_left ? (v2d->mask.xmin + category_tabs_width) - (category_tabs_width / 5) : | ||||
| (v2d->mask.xmax - category_tabs_width) + (category_tabs_width / 5), | (v2d->mask.xmax - category_tabs_width) + (category_tabs_width / 5), | ||||
| rct->ymax + (px * 3)); | rct->ymax + (px * 3)); | ||||
| Show All 17 Lines | #endif | ||||
| true, | true, | ||||
| tab_curve_radius, | tab_curve_radius, | ||||
| is_active ? theme_col_tab_active : theme_col_tab_inactive); | is_active ? theme_col_tab_active : theme_col_tab_inactive); | ||||
| UI_draw_roundbox_4fv(&box_rect, false, tab_curve_radius, theme_col_tab_outline); | UI_draw_roundbox_4fv(&box_rect, false, tab_curve_radius, theme_col_tab_outline); | ||||
| /* Disguise the outline on one side to join the tab to the panel. */ | /* Disguise the outline on one side to join the tab to the panel. */ | ||||
| pos = GPU_vertformat_attr_add( | pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformColor4fv(is_active ? theme_col_tab_active : theme_col_tab_inactive); | immUniformColor4fv(is_active ? theme_col_tab_active : theme_col_tab_inactive); | ||||
| immRecti(pos, | immRecti(pos, | ||||
| is_left ? rct->xmax - px : rct->xmin, | is_left ? rct->xmax - px : rct->xmin, | ||||
| rct->ymin + px, | rct->ymin + px, | ||||
| is_left ? rct->xmax : rct->xmin + px, | is_left ? rct->xmax : rct->xmin + px, | ||||
| rct->ymax - px); | rct->ymax - px); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| ▲ Show 20 Lines • Show All 1,107 Lines • Show Last 20 Lines | |||||