Page MenuHome

Alternating row color in Sequencer
ClosedPublic

Authored by Erik Abrahamsson (erik85) on Nov 23 2020, 11:07 PM.

Details

Summary

This patch adds support for changing the alternating row color in the Sequence Editor.

Diff Detail

Repository
rB Blender

Event Timeline

Erik Abrahamsson (erik85) requested review of this revision.Nov 23 2020, 11:07 PM
Erik Abrahamsson (erik85) created this revision.

Looks good, thanks for doing this. I'll commit with my change to the versioning code.

source/blender/blenloader/intern/versioning_userdef.c
263–265

There is no need for the upper bound clamping here, and the float function is a bit misleading. Here's my suggestion:

/* Remove the hardcoded fading from the sequence editor's background,
 * switching to the same method as the the file browser and outliner. */
btheme->space_sequencer.back[0] -= 25;
btheme->space_sequencer.back[1] -= 25;
btheme->space_sequencer.back[2] -= 25;
CLAMP_MIN(btheme->space_sequencer.back[0], 0);
CLAMP_MIN(btheme->space_sequencer.back[1], 0);
CLAMP_MIN(btheme->space_sequencer.back[2], 0);
source/blender/editors/space_sequencer/sequencer_draw.c
1879

I could also go either way with immRect or this. Since this is already written and since your hunch about performance makes a bit of sense, let's go with this.

This revision is now accepted and ready to land.Nov 24 2020, 9:20 PM
Hans Goudey (HooglyBoogly) requested changes to this revision.Nov 24 2020, 10:17 PM

Actually, I'm noticing some before and after differences here. The other uses of TH_BACK in this file should be adjusted to the change in the color, specifically in seq_draw_sfra_efra.

This revision now requires changes to proceed.Nov 24 2020, 10:17 PM
Erik Abrahamsson (erik85) edited the summary of this revision. (Show Details)

I ended up almost where I started. According to me this is the easiest way to solve it.
Changing the background color just moved the complications to other parts of the code.

Added versioning to create the default row_alternate color.

This revision is now accepted and ready to land.Nov 25 2020, 10:38 PM