Fix #147259: new Timeline / Dope Sheet always shows summary backdrop color
Only draw the Summary backdrop color when the Summary channel has been expanded. This prevents the default used-to-be-timeline Dope Sheet from showing a big red bar at the bottom of the window. The channel box backdrop (when the channel bar is expanded) also follows this, so when expanded it is red as before, and when collapsed it is dark grey. Pull Request: https://projects.blender.org/blender/blender/pulls/147708
This commit is contained in:
@@ -419,10 +419,13 @@ static bool acf_generic_dataexpand_setting_valid(bAnimContext *ac,
|
||||
/* Animation Summary ----------------------------------- */
|
||||
|
||||
/* get backdrop color for summary widget */
|
||||
static void acf_summary_color(bAnimContext * /*ac*/, bAnimListElem * /*ale*/, float r_color[3])
|
||||
static void acf_summary_color(bAnimContext *ac, bAnimListElem *ale, float r_color[3])
|
||||
{
|
||||
/* reddish color - same as the 'action' line in NLA */
|
||||
UI_GetThemeColor3fv(TH_ANIM_ACTIVE, r_color);
|
||||
/* Only draw the summary line backdrop when it is expanded. If the entire dope sheet is
|
||||
* just one line, there is no need for any distinction between lines, and the red-ish
|
||||
* color is only going to be a distraction. */
|
||||
const bool is_expanded = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND);
|
||||
UI_GetThemeColor3fv(is_expanded ? TH_ANIM_ACTIVE : TH_HEADER, r_color);
|
||||
}
|
||||
|
||||
/* backdrop for summary widget */
|
||||
|
||||
@@ -216,7 +216,12 @@ static void draw_backdrops(bAnimContext *ac, ListBase &anim_data, View2D *v2d, u
|
||||
if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY)) {
|
||||
switch (ale->type) {
|
||||
case ANIMTYPE_SUMMARY: {
|
||||
/* reddish color from NLA */
|
||||
if (!ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND)) {
|
||||
/* Only draw the summary line backdrop when it is expanded. If the entire dope sheet is
|
||||
* just one line, there is no need for any distinction between lines, and the red-ish
|
||||
* color is only going to be a distraction. */
|
||||
continue;
|
||||
}
|
||||
immUniformThemeColor(TH_ANIM_ACTIVE);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user