Added expander button animation
This commit is contained in:
parent
932697b836
commit
18d7290c61
1 changed files with 28 additions and 2 deletions
|
|
@ -457,9 +457,35 @@ TimelineHeaderContainer::draw_header_decoration(
|
|||
else if(hoveringExpander == timeline_track)
|
||||
state_type = STATE_PRELIGHT;
|
||||
|
||||
const ExpanderStyle expander_style =
|
||||
timeline_track->get_expanded() ?
|
||||
ExpanderStyle expander_style;
|
||||
const int animation_state =
|
||||
timeline_track->get_expand_animation_state();
|
||||
|
||||
if(animation_state == Track::NoAnimationState)
|
||||
expander_style = timeline_track->get_expanded() ?
|
||||
EXPANDER_EXPANDED : EXPANDER_COLLAPSED;
|
||||
else
|
||||
{
|
||||
const int notch = Track::MaxExpandAnimation / 3;
|
||||
if(timeline_track->get_expanded())
|
||||
{
|
||||
if(animation_state >= notch * 2)
|
||||
expander_style = EXPANDER_SEMI_EXPANDED;
|
||||
else if(animation_state >= notch)
|
||||
expander_style = EXPANDER_SEMI_COLLAPSED;
|
||||
else
|
||||
expander_style = EXPANDER_COLLAPSED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(animation_state <= notch)
|
||||
expander_style = EXPANDER_COLLAPSED;
|
||||
else if(animation_state <= notch * 2)
|
||||
expander_style = EXPANDER_SEMI_COLLAPSED;
|
||||
else
|
||||
expander_style = EXPANDER_SEMI_EXPANDED;
|
||||
}
|
||||
}
|
||||
|
||||
if(!model_track->get_child_tracks().empty())
|
||||
style->paint_expander (gdkWindow,
|
||||
|
|
|
|||
Loading…
Reference in a new issue