do not manage the remote control menu, since it is explicitly deleted during destruct...
[ardour.git] / gtk2_ardour / time_axis_view.cc
index d852fc1277cf2229bac4ec0798916eb7e46a4e7c..f36a6b71c0386d3c95abbeb2deaaab534f06e2b0 100644 (file)
@@ -235,25 +235,8 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
        order = nth;
 
        if (y_position != y) {
-               /* the coordinates used here are in the system of the
-                  item's parent ...
-               */
                canvas_display->property_y () = y;
-//             canvas_display->move (0.0, 0.0);
-
-               Group* pg;
-               double ix1, iy1, ix2, iy2;
-               canvas_display->get_bounds (ix1, iy1, ix2, iy2);
-               iy1 += editor.get_trackview_group_vertical_offset ();
-               pg = canvas_display->property_parent();
-               pg->i2w (ix1, iy1);
-               
-               if (iy1 < 0) {
-                       iy1 = 0;
-               }
-
-               canvas_display->move (0.0, y - iy1);
-
+               canvas_display->move (0.0, 0.0);
                y_position = y;
 
        }
@@ -261,7 +244,6 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
        canvas_display->raise_to_top ();
 
        if (_marked_for_display) {
-               canvas_display->show();
                controls_hbox.show ();
                controls_ebox.show ();
        }
@@ -282,6 +264,19 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
        return effective_height;
 }
 
+void
+TimeAxisView::clip_to_viewport ()
+{
+       if (_marked_for_display) {
+               if (y_position  +  effective_height < editor.get_trackview_group_vertical_offset () || y_position > editor.get_trackview_group_vertical_offset () + canvas_display->get_canvas()->get_height()) {
+                       canvas_display->hide ();
+                       return;
+               }
+               canvas_display->show ();
+       }
+       return;
+}
+
 bool
 TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
 {
@@ -987,7 +982,7 @@ TimeAxisView::get_state ()
 
        snprintf (buf, sizeof(buf), "%u", height);
        node->add_property ("height", buf);
-       node->add_property ("marked_for_display", (_marked_for_display ? "1" : "0"));
+       node->add_property ("marked-for-display", (_marked_for_display ? "1" : "0"));
        return *node;
 }
 
@@ -996,11 +991,11 @@ TimeAxisView::set_state (const XMLNode& node)
 {
        const XMLProperty *prop;
 
-       if ((prop = node.property ("marked_for_display")) != 0) {
+       if ((prop = node.property ("marked-for-display")) != 0) {
                _marked_for_display = (prop->value() == "1");
        }
 
-       if ((prop = node.property ("track_height")) != 0) {
+       if ((prop = node.property ("track-height")) != 0) {
 
                if (prop->value() == "largest") {
                        set_height (hLargest);
@@ -1049,8 +1044,8 @@ TimeAxisView::compute_controls_size_info ()
        Gtk::Table one_row_table (1, 8);
        Button* buttons[5];
        const int border_width = 2;
-       const int extra_height = (2 * border_width)
-               + 2   // 2 pixels for the hseparator between TimeAxisView control areas
+       const int extra_height = (2 * border_width)
+               //+ 2   // 2 pixels for the hseparator between TimeAxisView control areas
                + 10; // resizer button (3 x 2 pixel elements + 2 x 2 pixel gaps)
 
        window.add (one_row_table);
@@ -1188,8 +1183,6 @@ TimeAxisView::covers_y_position (double y)
                return 0;
        }
 
-       cerr << name() << " check for " << y << " within " << y_position << " and + " << height << endl;
-
        if (y_position <= y && y < (y_position + height)) {
                return this;
        }