Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_panel.cc
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| false, | false, | ||||
| UI_NO_ICON_OVERLAY_TEXT); | UI_NO_ICON_OVERLAY_TEXT); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| /* Draw drag widget. */ | /* Draw drag widget. */ | ||||
| if (!is_subpanel && show_background) { | if (!is_subpanel && show_background) { | ||||
| const int drag_widget_size = header_height * 0.7f; | const int drag_widget_size = header_height * 0.7f; | ||||
| GPU_blend(GPU_BLEND_ALPHA); | |||||
| GPU_matrix_push(); | GPU_matrix_push(); | ||||
| /* The magic numbers here center the widget vertically and offset it to the left. | /* The magic numbers here center the widget vertically and offset it to the left. | ||||
| * Currently this depends on the height of the header, although it could be independent. */ | * Currently this depends on the height of the header, although it could be independent. */ | ||||
| GPU_matrix_translate_2f(widget_rect.xmax - scaled_unit * 1.15, | GPU_matrix_translate_2f(widget_rect.xmax - scaled_unit * 0.8, widget_rect.ymin); | ||||
| widget_rect.ymin + (header_height - drag_widget_size) * 0.5f); | |||||
| const int col_tint = 84; | |||||
| float color_high[4], color_dark[4]; | float color_high[4], color_dark[4]; | ||||
| UI_GetThemeColorShade4fv(TH_PANEL_HEADER, col_tint, color_high); | UI_GetThemeColor3fv(TH_TITLE, color_high); | ||||
| UI_GetThemeColorShade4fv(TH_PANEL_BACK, -col_tint, color_dark); | color_high[3] = 0.4f; | ||||
| UI_GetThemeColor4fv(TH_WIDGET_EMBOSS, color_dark); | |||||
| GPUBatch *batch = GPU_batch_preset_panel_drag_widget( | GPUBatch *batch = GPU_batch_preset_panel_drag_widget( | ||||
| U.pixelsize, color_high, color_dark, drag_widget_size); | U.pixelsize, color_high, color_dark, drag_widget_size); | ||||
| GPU_batch_program_set_builtin(batch, GPU_SHADER_3D_FLAT_COLOR); | GPU_batch_program_set_builtin(batch, GPU_SHADER_3D_FLAT_COLOR); | ||||
| GPU_batch_draw(batch); | GPU_batch_draw(batch); | ||||
| GPU_matrix_pop(); | GPU_matrix_pop(); | ||||
| GPU_blend(GPU_BLEND_NONE); | |||||
| } | } | ||||
| } | } | ||||
| static void panel_draw_aligned_backdrop(const Panel *panel, | static void panel_draw_aligned_backdrop(const Panel *panel, | ||||
| const rcti *rect, | const rcti *rect, | ||||
| const rcti *header_rect) | const rcti *header_rect) | ||||
| { | { | ||||
| const bool is_subpanel = panel->type->parent != nullptr; | const bool is_subpanel = panel->type->parent != nullptr; | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||