summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_canvas.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2005-12-12 20:54:55 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2005-12-12 20:54:55 +0000
commit3733c995c5269756ca5941a9db50c6a965787508 (patch)
treee2152d49f8bd6daadf616d7b68aed2c8350d105a /gtk2_ardour/editor_canvas.cc
parent088a5289dc41b9066e9f518b94af546f80601d56 (diff)
editor window layout changes, and lots more
git-svn-id: svn://localhost/trunk/ardour2@187 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r--gtk2_ardour/editor_canvas.cc31
1 files changed, 25 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 1e02d34ce9..993ad24006 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -304,10 +304,7 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc)
edit_cursor->set_position (edit_cursor->current_frame);
playhead_cursor->set_position (playhead_cursor->current_frame);
- double last_canvas_unit = ceil ((double) max_frames / frames_per_unit);
-
- track_canvas.set_scroll_region ( 0.0, 0.0, max (last_canvas_unit, canvas_width), canvas_height);
- time_canvas.set_scroll_region ( 0.0, 0.0, max (last_canvas_unit, canvas_width), canvas_height);
+ reset_scrolling_region ();
if (edit_cursor) edit_cursor->set_length (canvas_height);
if (playhead_cursor) playhead_cursor->set_length (canvas_height);
@@ -357,19 +354,41 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc)
void
Editor::reset_scrolling_region (Gtk::Allocation* alloc)
{
+ TreeModel::Children rows = route_display_model->children();
+ TreeModel::Children::iterator i;
+ double pos;
+
+ for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
+ TimeAxisView *tv = (*i)[route_display_columns.tv];
+ pos += tv->effective_height;
+ }
+
+ RefPtr<Gdk::Screen> screen = get_screen();
+
+ if (!screen) {
+ screen = Gdk::Screen::get_default();
+ }
+
+ edit_controls_hbox.set_size_request (-1, min ((gint) pos, (screen->get_height() - 400)));
+ edit_controls_vbox.set_size_request (-1, min ((gint) pos, (screen->get_height() - 400)));
+ double last_canvas_unit = ceil ((double) max_frames / frames_per_unit);
+ track_canvas.set_scroll_region (0.0, 0.0, max (last_canvas_unit, canvas_width), pos);
+
+ // XXX what is the correct height value for the time canvas ? this overstates it
+ time_canvas.set_scroll_region ( 0.0, 0.0, max (last_canvas_unit, canvas_width), canvas_height);
}
bool
Editor::track_canvas_map_handler (GdkEventAny* ev)
{
- track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
+ track_canvas.get_window()->set_cursor (*current_canvas_cursor);
return false;
}
bool
Editor::time_canvas_map_handler (GdkEventAny* ev)
{
- time_canvas_scroller.get_window()->set_cursor (*timebar_cursor);
+ time_canvas.get_window()->set_cursor (*timebar_cursor);
return false;
}