summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-04-30 22:42:58 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-04-30 22:42:58 +0000
commit77ebc1fb423e400de7448e0154f65bc73ff51cf1 (patch)
tree84d8f62c1682a86147a58a45e6bcf84b92b5275e /gtk2_ardour/editor_ops.cc
parent53199152fdb49df703c2d87a778bc7e37663499d (diff)
make resize button more visible; make standard heights the right size to hold it; first part of zoom-to-region scales track size
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3299 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 95c0696118..8cb55a1cf1 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -23,6 +23,7 @@
#include <cmath>
#include <string>
#include <map>
+#include <set>
#include <pbd/error.h>
#include <pbd/basename.h>
@@ -1692,6 +1693,7 @@ Editor::temporal_zoom_region ()
nframes64_t start = max_frames;
nframes64_t end = 0;
RegionSelection rs;
+ set<TimeAxisView*> tracks;
get_regions_for_action (rs);
@@ -1706,6 +1708,8 @@ Editor::temporal_zoom_region ()
if ((*i)->region()->last_frame() + 1 > end) {
end = (*i)->region()->last_frame() + 1;
}
+
+ tracks.insert (&((*i)->get_time_axis_view()));
}
/* now comes an "interesting" hack ... make sure we leave a little space
@@ -1733,6 +1737,15 @@ Editor::temporal_zoom_region ()
}
temporal_zoom_by_frame (start, end, "zoom to region");
+
+ uint32_t per_track_height = (uint32_t) floor ((canvas_height - 10.0) / tracks.size());
+
+ for (set<TimeAxisView*>::iterator t = tracks.begin(); t != tracks.end(); ++t) {
+ (*t)->set_height (per_track_height);
+ }
+
+ vertical_adjustment.set_value (std::max ((*tracks.begin())->y_position - 5.0, 0.0));
+
zoomed_to_region = true;
}