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"
This commit is contained in:
parent
8b93576c18
commit
5668eea2a3
@ -737,6 +737,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||
/* The group used for region motion. Sits on top of _trackview_group */
|
||||
ArdourCanvas::Group* _region_motion_group;
|
||||
|
||||
/* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable
|
||||
* target area.
|
||||
*/
|
||||
ArdourCanvas::Rectangle* _canvas_bottom_rect;
|
||||
bool canvas_bottom_rect_event (GdkEvent* event);
|
||||
|
||||
enum RulerType {
|
||||
ruler_metric_timecode = 0,
|
||||
ruler_metric_bbt = 1,
|
||||
|
@ -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
|
||||
|
@ -1009,6 +1009,13 @@ Editor::canvas_note_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||
return typed_event (item, event, NoteItem);
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::canvas_bottom_rect_event (GdkEvent* event)
|
||||
{
|
||||
cerr << "CBR event, type " << event << endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, int x, int y, guint time)
|
||||
{
|
||||
@ -1191,3 +1198,4 @@ Editor::key_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user