Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/anim_scrubbing.c
| Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; | const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; | ||||
| const unsigned char color[] = {255, 255, 255, 255}; | const unsigned char color[] = {255, 255, 255, 255}; | ||||
| int frame_x = UI_view2d_view_to_region_x(v2d, current_frame); | int frame_x = UI_view2d_view_to_region_x(v2d, current_frame); | ||||
| char frame_str[64]; | char frame_str[64]; | ||||
| get_current_time_str(scene, display_seconds, current_frame, sizeof(frame_str), frame_str); | get_current_time_str(scene, display_seconds, current_frame, sizeof(frame_str), frame_str); | ||||
| float text_width = UI_fontstyle_string_width(fstyle, frame_str); | float text_width = UI_fontstyle_string_width(fstyle, frame_str); | ||||
| float box_width = text_width + 10 * UI_DPI_FAC; | float box_width = MAX2(text_width + 8 * UI_DPI_FAC, 24 * UI_DPI_FAC); | ||||
| float box_padding = 3 * UI_DPI_FAC; | float box_padding = 3 * UI_DPI_FAC; | ||||
| float bg_color[4]; | float bg_color[4]; | ||||
| UI_GetThemeColor4fv(TH_CFRAME, bg_color); | UI_GetThemeColorShade4fv(TH_CFRAME, -5, bg_color); | ||||
| bg_color[3] = 8.0f; | |||||
| UI_draw_roundbox_corner_set(UI_CNR_ALL); | UI_draw_roundbox_corner_set(UI_CNR_ALL); | ||||
| UI_draw_roundbox_aa(true, | |||||
| frame_x - box_width / 2, | UI_draw_roundbox_3fvAlpha(true, | ||||
| frame_x - box_width / 2 + U.pixelsize / 2, | |||||
| scrubbing_region_rect->ymin + box_padding, | |||||
| frame_x + box_width / 2 + U.pixelsize / 2, | |||||
| scrubbing_region_rect->ymax - box_padding, | |||||
| 4 * UI_DPI_FAC, | |||||
| bg_color, | |||||
| 1.0f); | |||||
| UI_GetThemeColorShade4fv(TH_CFRAME, 5, bg_color); | |||||
| UI_draw_roundbox_aa(false, | |||||
| frame_x - box_width / 2 + U.pixelsize / 2, | |||||
| scrubbing_region_rect->ymin + box_padding, | scrubbing_region_rect->ymin + box_padding, | ||||
| frame_x + box_width / 2, | frame_x + box_width / 2 + U.pixelsize / 2, | ||||
| scrubbing_region_rect->ymax - box_padding, | scrubbing_region_rect->ymax - box_padding, | ||||
| 5 * UI_DPI_FAC, | 4 * UI_DPI_FAC, | ||||
| bg_color); | bg_color); | ||||
| UI_fontstyle_draw_simple(fstyle, | UI_fontstyle_draw_simple(fstyle, | ||||
| frame_x - text_width / 2, | frame_x - text_width / 2 + U.pixelsize / 2, | ||||
| get_centered_text_y(scrubbing_region_rect), | get_centered_text_y(scrubbing_region_rect), | ||||
| frame_str, | frame_str, | ||||
| color); | color); | ||||
| } | } | ||||
| void ED_scrubbing_draw(const ARegion *ar, | void ED_scrubbing_draw(const ARegion *ar, | ||||
| const Scene *scene, | const Scene *scene, | ||||
| bool display_seconds, | bool display_seconds, | ||||
| ▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines | |||||