diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-01-16 14:56:40 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-01-17 05:53:02 +0400 |
commit | d8fa72bfb187f8091aa22e6acc0b00d254b807db (patch) | |
tree | fd0335b0315ffb41a60a78a2e01798618f85772c /source/blender/editors/animation | |
parent | 5e5b0cee4fc364eade49798baa9e312e9211799b (diff) |
Assorted polish fixes for keyframe theme settings patch
* Version patching fixes for theme settings
* Added missing support for NLA (needed for the keyframes drawn in the action lines)
* Fix for a lack of contrast between selected and unselected extreme keyframe type
(restoring it back to the pre-patch color scheme)
* Fix for keyframes on protected channels not being drawn with partial opacity
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/keyframes_draw.c | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 05c390d1462..fd350ada15c 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -595,42 +595,56 @@ void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel, /* draw! */ if (ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH)) { - /* interior - hardcoded colors (for selected and unselected only) */ + float inner_col[4]; + + /* get interior colors from theme (for selected and unselected only) */ switch (key_type) { - case BEZT_KEYTYPE_BREAKDOWN: /* bluish frames for now */ + case BEZT_KEYTYPE_BREAKDOWN: /* bluish frames (default theme) */ { - if (sel) UI_ThemeColor(TH_KEYTYPE_BREAKDOWN_SELECT); - else UI_ThemeColor(TH_KEYTYPE_BREAKDOWN); + if (sel) UI_GetThemeColor4fv(TH_KEYTYPE_BREAKDOWN_SELECT, inner_col); + else UI_GetThemeColor4fv(TH_KEYTYPE_BREAKDOWN, inner_col); break; } - case BEZT_KEYTYPE_EXTREME: /* redish frames for now */ + case BEZT_KEYTYPE_EXTREME: /* reddish frames (default theme) */ { - if (sel) UI_ThemeColor(TH_KEYTYPE_EXTREME_SELECT); - else UI_ThemeColor(TH_KEYTYPE_EXTREME); + if (sel) UI_GetThemeColor4fv(TH_KEYTYPE_EXTREME_SELECT, inner_col); + else UI_GetThemeColor4fv(TH_KEYTYPE_EXTREME, inner_col); break; } - case BEZT_KEYTYPE_JITTER: /* greenish frames for now? */ + case BEZT_KEYTYPE_JITTER: /* greenish frames (default theme) */ { - if (sel) UI_ThemeColor(TH_KEYTYPE_JITTER_SELECT); - else UI_ThemeColor(TH_KEYTYPE_JITTER); + if (sel) UI_GetThemeColor4fv(TH_KEYTYPE_JITTER_SELECT, inner_col); + else UI_GetThemeColor4fv(TH_KEYTYPE_JITTER, inner_col); break; } - case BEZT_KEYTYPE_KEYFRAME: /* traditional yellowish frames for now */ + case BEZT_KEYTYPE_KEYFRAME: /* traditional yellowish frames (default theme) */ default: { - if (sel) UI_ThemeColor(TH_KEYTYPE_KEYFRAME_SELECT); - else UI_ThemeColor(TH_KEYTYPE_KEYFRAME); + if (sel) UI_GetThemeColor4fv(TH_KEYTYPE_KEYFRAME_SELECT, inner_col); + else UI_GetThemeColor4fv(TH_KEYTYPE_KEYFRAME, inner_col); break; } } + /* NOTE: we don't use the straight alpha from the theme, or else effects such as + * greying out protected/muted channels doesn't work correctly! + */ + inner_col[3] *= alpha; + glColor4fv(inner_col); + + /* draw the "filled in" interior poly now */ glCallList(displist2); } if (ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH)) { + float border_col[4]; + /* exterior - black frame */ - if (sel) UI_ThemeColor4(TH_KEYBORDER_SELECT); - else UI_ThemeColor4(TH_KEYBORDER); + if (sel) UI_GetThemeColor4fv(TH_KEYBORDER_SELECT, border_col); + else UI_GetThemeColor4fv(TH_KEYBORDER, border_col); + + border_col[3] *= alpha; + glColor4fv(border_col); glCallList(displist1); } |