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_action/action_draw.c
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_action/action_draw.c')
-rw-r--r--source/blender/editors/space_action/action_draw.c54
1 files changed, 40 insertions, 14 deletions
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index f5fa263eee8..4fb22064c17 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -397,7 +397,7 @@ static void action_icu_buts(SpaceAction *saction)
/* Channel List */
/* left hand part */
-void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
+void draw_channel_names(bContext *C, bAnimContext *ac, SpaceAction *saction, ARegion *ar)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
@@ -428,22 +428,48 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
UI_view2d_sync(NULL, ac->sa, v2d, V2D_VIEWSYNC_AREA_VERTICAL);
/* loop through channels, and set up drawing depending on their type */
- y= (float)ACHANNEL_FIRST;
-
- for (ale= anim_data.first; ale; ale= ale->next) {
- float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
- 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; ale; ale= ale->next) {
+ float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
+ 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, "dopesheet channel buttons", UI_EMBOSS);
- /* adjust y-position for next one */
- y -= ACHANNEL_STEP;
+ y= (float)ACHANNEL_FIRST;
+
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
+ 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;
+ }
+
+ uiEndBlock(C, block);
+ uiDrawBlock(C, block);
}
/* free tempolary channels */