From 4bbccd39bc827e5d794bdbe987b4d48164e8d950 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 14 Aug 2009 11:09:19 +0000 Subject: 2.5 - Assorted Animation UI Tweaks * Fixed padding for Graph Editor visibility toggles * Reverted many of the tweaks to Timeline UI for now (for the reasons outlined in earlier mail) * NLA Editor now (mostly) uses the new channel-drawing API --- .../editors/animation/anim_channels_defines.c | 45 +++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'source/blender/editors/animation/anim_channels_defines.c') diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 879296c58b8..32bda94f796 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -1874,10 +1874,10 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float glColor3fv(fcu->color); /* just a solid color rect - * hardcoded 18 pixels width is slightly wider than icon width, so that + * hardcoded 17 pixels width is slightly wider than icon width, so that * there's a slight border around it */ - glRectf(offset, yminc, offset+18, ymaxc); + glRectf(offset, yminc, offset+17, ymaxc); } /* finally the icon itself */ @@ -1913,34 +1913,35 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float UI_DrawString(offset, ytext, name); } - /* step 6) draw mute+protection toggles ............................. */ + /* step 6) draw mute+protection toggles + (sliders) ....................... */ /* reset offset - now goes from RHS of panel */ offset = 0; // TODO: we need a mechanism of drawing over (and hiding) stuff from here... + // TODO: when drawing sliders, make those draw instead of these toggles if not enough space - /* set blending again, as text drawing may clear it */ - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - /* protect... */ - // XXX v2d might not be valid - if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { - enabled= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_PROTECT); + if (v2d) { + /* set blending again, as text drawing may clear it */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); - offset += ICON_WIDTH; - UI_icon_draw(v2d->cur.xmax-(float)offset, ymid, ((enabled)? ICON_LOCKED : ICON_UNLOCKED)); - } - /* mute... */ - // XXX v2d might not be valid - if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) { - enabled= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_MUTE); + /* protect... */ + if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { + enabled= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_PROTECT); + + offset += ICON_WIDTH; + UI_icon_draw(v2d->cur.xmax-(float)offset, ymid, ((enabled)? ICON_LOCKED : ICON_UNLOCKED)); + } + /* mute... */ + if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) { + enabled= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_MUTE); + + offset += ICON_WIDTH; + UI_icon_draw(v2d->cur.xmax-(float)offset, ymid, ((enabled)? ICON_MUTE_IPO_ON : ICON_MUTE_IPO_OFF)); + } - offset += ICON_WIDTH; - UI_icon_draw(v2d->cur.xmax-(float)offset, ymid, ((enabled)? ICON_MUTE_IPO_ON : ICON_MUTE_IPO_OFF)); + glDisable(GL_BLEND); /* End of blending with background */ } - - glDisable(GL_BLEND); /* End of blending with background */ } /* *********************************************** */ -- cgit v1.2.3