summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view.cc
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2008-09-14 10:08:57 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2008-09-14 10:08:57 +0000
commitf1ef1b0069d7fb75a4ec0391823b0230dcb2abfe (patch)
tree0635683f9c56e7f04bb09ac014d9e370c3346bd2 /gtk2_ardour/time_axis_view.cc
parent4489fc159f522eb3f9b9bdf668df853d54ed4782 (diff)
Speed up track resizing, fix disappearing automation controls when automation track has been made minimum size.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3722 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r--gtk2_ardour/time_axis_view.cc76
1 files changed, 47 insertions, 29 deletions
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index 04d7c80533..4bf18a5ae5 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -211,51 +211,52 @@ TimeAxisView::~TimeAxisView()
guint32
TimeAxisView::show_at (double y, int& nth, VBox *parent)
{
- gdouble ix1, ix2, iy1, iy2;
- effective_height = 0;
-
if (control_parent) {
control_parent->reorder_child (controls_frame, nth);
- } else {
+ } else {
control_parent = parent;
parent->pack_start (controls_frame, false, false);
parent->reorder_child (controls_frame, nth);
}
- controls_frame.show ();
- controls_ebox.show ();
-
- /* the coordinates used here are in the system of the
- item's parent ...
- */
- canvas_display->get_bounds (ix1, iy1, ix2, iy2);
- iy1 += editor.get_trackview_group_vertical_offset ();
- Group* pg = canvas_display->property_parent();
- pg->i2w (ix1, iy1);
+ order = nth;
+
+ if (y_position != y) {
+ /* the coordinates used here are in the system of the
+ item's parent ...
+ */
+ 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);
+ y_position = y;
- if (iy1 < 0) {
- iy1 = 0;
}
- canvas_display->move (0.0, y - iy1);
- canvas_display->show();/* XXX not necessary */
- y_position = y;
- order = nth;
+ canvas_display->raise_to_top ();
+
+ if (_marked_for_display && _hidden) {
+ canvas_display->show();
+ controls_frame.show ();
+ controls_ebox.show ();
+ }
+
_hidden = false;
- /* height in pixels depends on _order, so update it now we've changed _order */
- set_height (height);
-
effective_height = current_height();
/* now show children */
for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
- if ((*i)->marked_for_display()) {
- (*i)->canvas_display->show();
- }
-
if (canvas_item_visible ((*i)->canvas_display)) {
++nth;
effective_height += (*i)->show_at (y + effective_height, nth, parent);
@@ -376,9 +377,26 @@ TimeAxisView::set_heights (uint32_t h)
void
TimeAxisView::set_height(uint32_t h)
{
- height = h;
+ /* XXX suboptimal to give the 0th controls frame a different height.
+ it would be better to offset the entire controls_frame by one pixel..
+ */
+ int x,y;
+ controls_frame.get_size_request (x, y);
+ if (order == 0) {
+ if (y != h + 1) {
+ controls_frame.set_size_request (-1, h + 1);
+ }
+ } else {
+ if (y != h) {
+ controls_frame.set_size_request (-1, h);
+ }
+ }
- controls_frame.set_size_request (-1, current_height() + ((order == 0) ? 1 : 0));
+ if (h == height) {
+ return;
+ }
+
+ height = h;
if (canvas_item_visible (selection_group)) {
/* resize the selection rect */