Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/file_draw.c
| Show First 20 Lines • Show All 435 Lines • ▼ Show 20 Lines | |||||
| static void draw_background(FileLayout *layout, View2D *v2d) | static void draw_background(FileLayout *layout, View2D *v2d) | ||||
| { | { | ||||
| const int item_height = layout->tile_h + (2 * layout->tile_border_y); | const int item_height = layout->tile_h + (2 * layout->tile_border_y); | ||||
| int i; | int i; | ||||
| int sy; | int sy; | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
| immUniformThemeColorShade(TH_BACK, -7); | float col_alternating[4]; | ||||
| UI_GetThemeColor4fv(TH_ROW_ALTERNATE, col_alternating); | |||||
| immUniformThemeColorBlend(TH_BACK, TH_ROW_ALTERNATE, col_alternating[3]); | |||||
| /* alternating flat shade background */ | /* alternating flat shade background */ | ||||
| for (i = 2; (i <= layout->rows + 1); i += 2) { | for (i = 2; (i <= layout->rows + 1); i += 2) { | ||||
| sy = (int)v2d->cur.ymax - layout->offset_top - i * item_height - layout->tile_border_y; | sy = (int)v2d->cur.ymax - layout->offset_top - i * item_height - layout->tile_border_y; | ||||
| /* Offsett pattern slightly to add scroll effect. */ | /* Offsett pattern slightly to add scroll effect. */ | ||||
| sy += round_fl_to_int(item_height * (v2d->tot.ymax - v2d->cur.ymax) / item_height); | sy += round_fl_to_int(item_height * (v2d->tot.ymax - v2d->cur.ymax) / item_height); | ||||
| ▲ Show 20 Lines • Show All 454 Lines • Show Last 20 Lines | |||||