diff options
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 15 | ||||
-rw-r--r-- | source/blender/editors/include/ED_markers.h | 3 | ||||
-rw-r--r-- | source/blender/editors/include/UI_view2d.h | 3 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_nla/space_nla.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 2 |
8 files changed, 23 insertions, 8 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 58db93b4586..bb959ad06e5 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -418,12 +418,25 @@ void draw_markers_time(const bContext *C, int flag) TimeMarker *marker; Scene *scene; - if (markers == NULL) + if (markers == NULL || BLI_listbase_is_empty(markers)) { return; + } scene = CTX_data_scene(C); v2d = UI_view2d_fromcontext(C); + if (flag & DRAW_MARKERS_MARGIN) { + const unsigned char shade[4] = {0, 0, 0, 16}; + glColor4ubv(shade); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glRectf(v2d->cur.xmin, 0, v2d->cur.xmax, UI_MARKER_MARGIN_Y); + + glDisable(GL_BLEND); + } + /* unselected markers are drawn at the first time */ for (marker = markers->first; marker; marker = marker->next) { if ((marker->flag & SELECT) == 0) { diff --git a/source/blender/editors/include/ED_markers.h b/source/blender/editors/include/ED_markers.h index 76d36623b60..241cd700c20 100644 --- a/source/blender/editors/include/ED_markers.h +++ b/source/blender/editors/include/ED_markers.h @@ -43,7 +43,8 @@ struct TimeMarker; /* flags for drawing markers */ enum { DRAW_MARKERS_LINES = (1 << 0), - DRAW_MARKERS_LOCAL = (1 << 1) + DRAW_MARKERS_LOCAL = (1 << 1), + DRAW_MARKERS_MARGIN = (1 << 2), }; void draw_markers_time(const struct bContext *C, int flag); diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 0f190bc0afc..4d7446a7a81 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -234,5 +234,6 @@ void ED_keymap_view2d(struct wmKeyConfig *keyconf); void UI_view2d_smooth_view(struct bContext *C, struct ARegion *ar, const struct rctf *cur, const int smooth_viewtx); -#endif /* __UI_VIEW2D_H__ */ +#define UI_MARKER_MARGIN_Y (42 * UI_DPI_FAC) +#endif /* __UI_VIEW2D_H__ */ diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index e38f3b5bee6..ed224b2d5c2 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1331,7 +1331,7 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand ARegion *ar; /* same local check for all areas */ static rcti rect = {0, 10000, 0, -1}; - rect.ymax = (30 * UI_DPI_FAC); + rect.ymax = UI_MARKER_MARGIN_Y; ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); if (ar) { WM_event_add_keymap_handler_bb(handlers, keymap, &rect, &ar->winrct); diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 7ca8968a705..ba68becaed1 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -197,7 +197,7 @@ static void action_main_area_draw(const bContext *C, ARegion *ar) /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); - flag = (ac.markers && (ac.markers != &ac.scene->markers)) ? DRAW_MARKERS_LOCAL : 0; + flag = ((ac.markers && (ac.markers != &ac.scene->markers)) ? DRAW_MARKERS_LOCAL : 0) | DRAW_MARKERS_MARGIN; draw_markers_time(C, flag); /* preview range */ diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 6dba706b241..7ed1c2237dc 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -293,7 +293,7 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); - draw_markers_time(C, 0); + draw_markers_time(C, DRAW_MARKERS_MARGIN); /* preview range */ UI_view2d_view_ortho(v2d); diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 134e5dd80a2..f36016b612f 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -305,7 +305,7 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); - draw_markers_time(C, 0); + draw_markers_time(C, DRAW_MARKERS_MARGIN); /* preview range */ UI_view2d_view_ortho(v2d); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index f9ca713ad2d..383da74278e 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1487,7 +1487,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); - draw_markers_time(C, DRAW_MARKERS_LINES); + draw_markers_time(C, DRAW_MARKERS_LINES | DRAW_MARKERS_MARGIN); /* preview range */ UI_view2d_view_ortho(v2d); |