Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_text/text_draw.c
| Show First 20 Lines • Show All 1,004 Lines • ▼ Show 20 Lines | UI_draw_widget_scroll(&wcol, | ||||
| &st->runtime.scroll_region_handle, | &st->runtime.scroll_region_handle, | ||||
| (st->flags & ST_SCROLL_SELECT) ? UI_SCROLL_PRESSED : 0); | (st->flags & ST_SCROLL_SELECT) ? UI_SCROLL_PRESSED : 0); | ||||
| UI_draw_roundbox_corner_set(UI_CNR_ALL); | UI_draw_roundbox_corner_set(UI_CNR_ALL); | ||||
| rad = 0.4f * min_ii(BLI_rcti_size_x(&st->runtime.scroll_region_select), | rad = 0.4f * min_ii(BLI_rcti_size_x(&st->runtime.scroll_region_select), | ||||
| BLI_rcti_size_y(&st->runtime.scroll_region_select)); | BLI_rcti_size_y(&st->runtime.scroll_region_select)); | ||||
| UI_GetThemeColor3fv(TH_HILITE, col); | UI_GetThemeColor3fv(TH_HILITE, col); | ||||
| col[3] = 0.18f; | col[3] = 0.18f; | ||||
| UI_draw_roundbox_aa(true, | UI_draw_roundbox_aa( | ||||
| st->runtime.scroll_region_select.xmin + 1, | &(const rctf){ | ||||
| st->runtime.scroll_region_select.ymin, | .xmin = st->runtime.scroll_region_select.xmin + 1, | ||||
| st->runtime.scroll_region_select.xmax - 1, | .xmax = st->runtime.scroll_region_select.xmax - 1, | ||||
| st->runtime.scroll_region_select.ymax, | .ymin = st->runtime.scroll_region_select.ymin, | ||||
| .ymax = st->runtime.scroll_region_select.ymax, | |||||
| }, | |||||
| true, | |||||
| rad, | rad, | ||||
| col); | col); | ||||
| } | } | ||||
| /*********************** draw documentation *******************************/ | /*********************** draw documentation *******************************/ | ||||
| #if 0 | #if 0 | ||||
| static void draw_documentation(const SpaceText *st, ARegion *region) | static void draw_documentation(const SpaceText *st, ARegion *region) | ||||
| { | { | ||||
| TextDrawContext tdc = {0}; | TextDrawContext tdc = {0}; | ||||
| ▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | static void draw_suggestion_list(const SpaceText *st, const TextDrawContext *tdc, ARegion *region) | ||||
| boxw = SUGG_LIST_WIDTH * st->runtime.cwidth_px + 20; | boxw = SUGG_LIST_WIDTH * st->runtime.cwidth_px + 20; | ||||
| boxh = SUGG_LIST_SIZE * lheight + 8; | boxh = SUGG_LIST_SIZE * lheight + 8; | ||||
| if (x + boxw > region->winx) { | if (x + boxw > region->winx) { | ||||
| x = MAX2(0, region->winx - boxw); | x = MAX2(0, region->winx - boxw); | ||||
| } | } | ||||
| /* not needed but stands out nicer */ | /* not needed but stands out nicer */ | ||||
| UI_draw_box_shadow(220, x, y - boxh, x + boxw, y); | UI_draw_box_shadow( | ||||
| &(const rctf){ | |||||
| .xmin = x, | |||||
| .xmax = x + boxw, | |||||
| .ymin = y - boxh, | |||||
| .ymax = y, | |||||
| }, | |||||
| 220); | |||||
| 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_2D_UNIFORM_COLOR); | ||||
| immUniformThemeColor(TH_SHADE1); | immUniformThemeColor(TH_SHADE1); | ||||
| immRecti(pos, x - 1, y + 1, x + boxw + 1, y - boxh - 1); | immRecti(pos, x - 1, y + 1, x + boxw + 1, y - boxh - 1); | ||||
| immUniformThemeColorShade(TH_BACK, 16); | immUniformThemeColorShade(TH_BACK, 16); | ||||
| ▲ Show 20 Lines • Show All 667 Lines • Show Last 20 Lines | |||||