summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_canvas.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-04-16 04:16:56 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-04-16 04:16:56 -0400
commit5668eea2a3b31352698232127c5876a0cd9f2925 (patch)
treee36331d71e3051a0cfd075d7e39dba6e39fc9a48 /gtk2_ardour/editor_canvas.cc
parent8b93576c180a62539baad83d2846b6da192eea6a (diff)
add a transparent rect that is always located at the bottom of the track canvas
This gives us an event/drag-n-drop/click target for things "at the bottom"
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r--gtk2_ardour/editor_canvas.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 98feae94c8..3b9c5dea37 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -212,6 +212,13 @@ Editor::initialize_canvas ()
logo_item->lower_to_bottom ();
}
+
+ _canvas_bottom_rect = new ArdourCanvas::Rectangle (_track_canvas->root(), ArdourCanvas::Rect (0.0, 0.0, max_canvas_coordinate, 20));
+ /* this thing is transparent */
+ _canvas_bottom_rect->set_fill (false);
+ _canvas_bottom_rect->set_outline (false);
+ _canvas_bottom_rect->Event.connect (sigc::mem_fun (*this, &Editor::canvas_bottom_rect_event));
+
/* these signals will initially be delivered to the canvas itself, but if they end up remaining unhandled, they are passed to Editor-level
handlers.
*/
@@ -316,12 +323,24 @@ Editor::reset_controls_layout_width ()
void
Editor::reset_controls_layout_height (int32_t h)
{
+ /* ensure that the rect that represents the "bottom" of the canvas
+ * (the drag-n-drop zone) is, in fact, at the bottom.
+ */
+
+ _canvas_bottom_rect->set_position (ArdourCanvas::Duple (0, h));
+
+ /* track controls layout must span the full height of "h" (all tracks)
+ * plus the bottom rect.
+ */
+
+ h += _canvas_bottom_rect->height ();
+
/* set the height of the scrollable area (i.e. the sum of all contained widgets)
+ * for the controls layout. The size request is set elsewhere.
*/
controls_layout.property_height() = h;
- /* size request is set elsewhere, see ::track_canvas_allocate() */
}
bool