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:
authorJoshua Leung <aligorith@gmail.com>2009-08-16 06:21:43 +0400
committerJoshua Leung <aligorith@gmail.com>2009-08-16 06:21:43 +0400
commitb257acfed11e8d98eb7c86e0908acf80fb9e27af (patch)
treea1b197d8355a6f66df48939627ea814eebf16fdd /source/blender/editors/space_graph
parentebf1c5faca86286aa90ab5ab9fc4d3ddb1f51cdf (diff)
Animation Editors: Code Cleanups (for Channel Lists) Part 2
Now the mute/protect/expand/etc. toggles are drawn using UI widgets. This means that special event handling code to determine when they were clicked on is no longer needed, and also means that there can now be tooltips for these items too. Also, added visibility toggles for ID-block expanders, which will cause all the F-Curves in the linked datablock to not get drawn. The backend filtering code to make this work will come later...
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c54
-rw-r--r--source/blender/editors/space_graph/graph_intern.h2
-rw-r--r--source/blender/editors/space_graph/space_graph.c2
3 files changed, 42 insertions, 16 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 46d067d9dd2..c2d8d7b1345 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -878,7 +878,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri
/* Channel List */
/* left hand part */
-void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
+void graph_draw_channel_names(bContext *C, bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
@@ -902,22 +902,48 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
UI_view2d_totRect_set(v2d, ar->winx, height);
/* loop through channels, and set up drawing depending on their type */
- y= (float)ACHANNEL_FIRST;
-
- for (ale= anim_data.first, i=0; ale; ale= ale->next, i++) {
- const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
- const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
+ { /* first pass: just the standard GL-drawing for backdrop + text */
+ y= (float)ACHANNEL_FIRST;
- /* check if visible */
- if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
- IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
- {
- /* draw all channels using standard channel-drawing API */
- ANIM_channel_draw(ac, ale, yminc, ymaxc);
+ for (ale= anim_data.first, i=0; ale; ale= ale->next, i++) {
+ const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
+ const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
+
+ /* check if visible */
+ if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
+ IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
+ {
+ /* draw all channels using standard channel-drawing API */
+ ANIM_channel_draw(ac, ale, yminc, ymaxc);
+ }
+
+ /* adjust y-position for next one */
+ y -= ACHANNEL_STEP;
+ }
+ }
+ { /* second pass: widgets */
+ uiBlock *block= uiBeginBlock(C, ar, "graph channel buttons", UI_EMBOSS);
+
+ y= (float)ACHANNEL_FIRST;
+
+ for (ale= anim_data.first, i=0; ale; ale= ale->next, i++) {
+ const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
+ const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
+
+ /* check if visible */
+ if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
+ IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
+ {
+ /* draw all channels using standard channel-drawing API */
+ ANIM_channel_draw_widgets(ac, ale, block, yminc, ymaxc);
+ }
+
+ /* adjust y-position for next one */
+ y -= ACHANNEL_STEP;
}
- /* adjust y-position for next one */
- y -= ACHANNEL_STEP;
+ uiEndBlock(C, block);
+ uiDrawBlock(C, block);
}
/* free tempolary channels */
diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h
index 31f1c6d4301..2e8d0655d2d 100644
--- a/source/blender/editors/space_graph/graph_intern.h
+++ b/source/blender/editors/space_graph/graph_intern.h
@@ -48,7 +48,7 @@ struct ARegion *graph_has_buttons_region(struct ScrArea *sa);
/* ***************************************** */
/* graph_draw.c */
-void graph_draw_channel_names(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar);
+void graph_draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar);
void graph_draw_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar, struct View2DGrid *grid, short sel);
void graph_draw_ghost_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar, struct View2DGrid *grid);
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 0390586951b..3717ccc8244 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -309,7 +309,7 @@ static void graph_channel_area_draw(const bContext *C, ARegion *ar)
/* draw channels */
if (ANIM_animdata_get_context(C, &ac)) {
- graph_draw_channel_names(&ac, sipo, ar);
+ graph_draw_channel_names((bContext*)C, &ac, sipo, ar);
}
/* reset view matrix */