Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-10-28 20:51:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2014-10-28 20:51:28 +0300
commit36da579d122fe49f3db8759e38d6ff1921939ad4 (patch)
treebad70381af315f67e824f9d23d794c171e122a02 /source/blender
parentb2b1d8e2908e5960b700c70a6baf93b9745845bc (diff)
Markers: show the area that handles marker events
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/animation/anim_markers.c15
-rw-r--r--source/blender/editors/include/ED_markers.h3
-rw-r--r--source/blender/editors/include/UI_view2d.h3
-rw-r--r--source/blender/editors/screen/area.c2
-rw-r--r--source/blender/editors/space_action/space_action.c2
-rw-r--r--source/blender/editors/space_graph/space_graph.c2
-rw-r--r--source/blender/editors/space_nla/space_nla.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c2
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);