Added dragging of whole branches
This commit is contained in:
parent
f93d224977
commit
0b5fb555b6
1 changed files with 14 additions and 13 deletions
|
|
@ -250,17 +250,21 @@ TimelineLayoutHelper::layout_headers_recursive(
|
||||||
iterator++)
|
iterator++)
|
||||||
{
|
{
|
||||||
Gdk::Rectangle rect;
|
Gdk::Rectangle rect;
|
||||||
|
int track_height = 0;
|
||||||
|
|
||||||
const shared_ptr<model::Track> &model_track = *iterator;
|
const shared_ptr<model::Track> &model_track = *iterator;
|
||||||
REQUIRE(model_track);
|
REQUIRE(model_track);
|
||||||
|
|
||||||
shared_ptr<timeline::Track> timeline_track =
|
shared_ptr<timeline::Track> timeline_track =
|
||||||
lookup_timeline_track(model_track);
|
lookup_timeline_track(model_track);
|
||||||
|
|
||||||
|
const bool being_dragged = (timeline_track == draggingTrack);
|
||||||
|
|
||||||
// Is the track going to be shown?
|
// Is the track going to be shown?
|
||||||
if(parent_expanded)
|
if(parent_expanded)
|
||||||
{
|
{
|
||||||
// Calculate and store the box of the header
|
// Calculate and store the box of the header
|
||||||
const int track_height = timeline_track->get_height();
|
track_height = timeline_track->get_height() +
|
||||||
|
TimelineWidget::TrackPadding;
|
||||||
const int indent = depth * indent_width;
|
const int indent = depth * indent_width;
|
||||||
|
|
||||||
rect = Gdk::Rectangle(
|
rect = Gdk::Rectangle(
|
||||||
|
|
@ -270,19 +274,15 @@ TimelineLayoutHelper::layout_headers_recursive(
|
||||||
track_height); // height
|
track_height); // height
|
||||||
|
|
||||||
// Offset for the next header
|
// Offset for the next header
|
||||||
child_offset += track_height + TimelineWidget::TrackPadding;
|
child_offset += track_height;
|
||||||
|
|
||||||
// Is this header being dragged?
|
// Is this header being dragged?
|
||||||
if(timeline_track == draggingTrack)
|
if(being_dragged)
|
||||||
{
|
|
||||||
rect.set_y(dragPoint.get_y() - dragStartOffset.get_y());
|
rect.set_y(dragPoint.get_y() - dragStartOffset.get_y());
|
||||||
}
|
|
||||||
|
|
||||||
headerBoxes[timeline_track] = rect;
|
headerBoxes[timeline_track] = rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Is the track animating?
|
// Is the track animating?
|
||||||
const bool is_track_animating =
|
const bool is_track_animating =
|
||||||
timeline_track->is_expand_animating();
|
timeline_track->is_expand_animating();
|
||||||
|
|
@ -294,8 +294,9 @@ TimelineLayoutHelper::layout_headers_recursive(
|
||||||
&& parent_expanded;
|
&& parent_expanded;
|
||||||
|
|
||||||
int child_branch_height = layout_headers_recursive(
|
int child_branch_height = layout_headers_recursive(
|
||||||
iterator, branch_offset + child_offset,
|
iterator, rect.get_y() + track_height,
|
||||||
header_width, indent_width, depth + 1, expand_child);
|
header_width, indent_width, depth + 1,
|
||||||
|
expand_child);
|
||||||
|
|
||||||
// Do collapse animation as necessary
|
// Do collapse animation as necessary
|
||||||
if(is_track_animating)
|
if(is_track_animating)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue