From 7b88ae24660422f92bcda2b276b4b28a2ae3dc09 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 17 Oct 2024 13:37:21 -0600 Subject: [PATCH] fix initial LR sizing of midi cue editor canvas sections --- gtk2_ardour/midi_cue_editor.cc | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/gtk2_ardour/midi_cue_editor.cc b/gtk2_ardour/midi_cue_editor.cc index 8c402a029e..b57cd54a11 100644 --- a/gtk2_ardour/midi_cue_editor.cc +++ b/gtk2_ardour/midi_cue_editor.cc @@ -78,19 +78,6 @@ MidiCueEditor::MidiCueEditor() _toolbox.pack_start (viewport(), true, true); - view = new MidiCueView (nullptr, 0, *data_group, *this, *bg, 0xff0000ff); - - bg->set_view (view); - prh->set_view (view); - - _verbose_cursor = new VerboseCursor (*this); - - // _playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event, X_("playhead")); - _playhead_cursor = new EditorCursor (*this, X_("playhead")); - _playhead_cursor->set_sensitive (UIConfiguration::instance().get_sensitize_playhead()); - - _snapped_cursor = new EditorCursor (*this, X_("snapped")); - set_mouse_mode (Editing::MouseContent, true); } @@ -280,6 +267,13 @@ MidiCueEditor::build_canvas () prh = new ArdourCanvas::PianoRollHeader (v_scroll_group, *bg); + view = new MidiCueView (nullptr, 0, *data_group, *this, *bg, 0xff0000ff); + + bg->set_view (view); + prh->set_view (view); + + /* This must be called after prh and bg have had their view set */ + double w, h; prh->size_request (w, h); @@ -289,6 +283,14 @@ MidiCueEditor::build_canvas () _timeline_origin = w; h_scroll_group->set_position (Duple (w, 0.)); + _verbose_cursor = new VerboseCursor (*this); + + // _playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event, X_("playhead")); + _playhead_cursor = new EditorCursor (*this, X_("playhead")); + _playhead_cursor->set_sensitive (UIConfiguration::instance().get_sensitize_playhead()); + + _snapped_cursor = new EditorCursor (*this, X_("snapped")); + _canvas->set_name ("MidiCueCanvas"); _canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK | Gdk::SCROLL_MASK | Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK); _canvas->set_can_focus ();