Fix some capitalisation in the preferences dialog.
[ardour.git] / gtk2_ardour / editor_canvas.cc
index f69cb4b4200cc1c191bd18b387ad5f97a26ce771..3b9c5dea379608c88c022783ca97950ccb81372b 100644 (file)
@@ -21,8 +21,6 @@
 #include "gtk2ardour-config.h"
 #endif
 
-#include <jack/types.h>
-
 #include "gtkmm2ext/utils.h"
 
 #include "ardour/profile.h"
@@ -64,7 +62,7 @@ using namespace Editing;
 
 /* XXX this is a hack. it ought to be the maximum value of an framepos_t */
 
-const double max_canvas_coordinate = (double) JACK_MAX_FRAMES;
+const double max_canvas_coordinate = (double) UINT32_MAX;
 
 void
 Editor::initialize_canvas ()
@@ -86,7 +84,7 @@ Editor::initialize_canvas ()
                // logo_item->property_width_in_pixels() = true;
                // logo_item->property_height_set() = true;
                // logo_item->property_width_set() = true;
-               logo_item->show ();
+               // logo_item->show ();
        }
        
        /*a group to hold global rects like punch/loop indicators */
@@ -214,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.
        */
@@ -260,7 +265,7 @@ Editor::track_canvas_viewport_allocate (Gtk::Allocation alloc)
        track_canvas_viewport_size_allocated ();
 }
 
-bool
+void
 Editor::track_canvas_viewport_size_allocated ()
 {
        bool height_changed = _visible_canvas_height != _canvas_viewport_allocation.get_height();
@@ -291,8 +296,6 @@ Editor::track_canvas_viewport_size_allocated ()
        update_fixed_rulers();
        redisplay_tempo (false);
        _summary->set_overlays_dirty ();
-
-       return false;
 }
 
 void
@@ -320,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