From aa5cf0ea3ab5755251d4cf57ca811d93cea09ebc Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 24 Jan 2009 14:33:49 +0000 Subject: [PATCH] Made a track expand when the dragging track is going to be dragged inside --- .../widgets/timeline/timeline-header-container.cpp | 12 +++++++++++- src/gui/widgets/timeline/timeline-layout-helper.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/timeline/timeline-header-container.cpp b/src/gui/widgets/timeline/timeline-header-container.cpp index c4e189081..0ac0df624 100644 --- a/src/gui/widgets/timeline/timeline-header-container.cpp +++ b/src/gui/widgets/timeline/timeline-header-container.cpp @@ -342,6 +342,8 @@ TimelineHeaderContainer::layout_headers() if(!gdkWindow) return; + bool headers_shown = false; + TimelineLayoutHelper &layout_helper = timelineWidget.layoutHelper; const TimelineLayoutHelper::TrackTree &layout_tree = @@ -368,12 +370,20 @@ TimelineHeaderContainer::layout_headers() // Apply the allocation to the header widget.size_allocate (*header_rect); if(!widget.is_visible()) - widget.show(); + { + widget.show(); + headers_shown = true; + } } else // No header rect, so the track must be hidden if(widget.is_visible()) widget.hide(); } + + // If headers have been shown while we're dragging, the dragging + // branch headers have to be brought back to the top again + if(headers_shown && layout_helper.is_dragging_track()) + raise_recursive(layout_helper.get_dragging_track_iter()); // Repaint the background of our parenting queue_draw(); diff --git a/src/gui/widgets/timeline/timeline-layout-helper.cpp b/src/gui/widgets/timeline/timeline-layout-helper.cpp index a06734d37..d5ab696a5 100644 --- a/src/gui/widgets/timeline/timeline-layout-helper.cpp +++ b/src/gui/widgets/timeline/timeline-layout-helper.cpp @@ -228,8 +228,19 @@ TimelineLayoutHelper::drag_to_point(const Gdk::Point &mouse_point) // Did we get a drop point? if(drop.relation != None) { + REQUIRE(*drop.target); + shared_ptr target_timeline_track = + lookup_timeline_track(*drop.target); + apply_drop_to_layout_tree(drop); dropPoint = drop; + + if((drop.relation == FirstChild || drop.relation == LastChild)&& + !target_timeline_track->get_expanded()) + { + target_timeline_track->expand_collapse(Track::Expand); + + } } update_layout();