track enter events on pianoroll to set current editing context

This commit is contained in:
Paul Davis 2025-01-22 18:20:20 -07:00
parent 42bbd1afd5
commit 322d4e670c
3 changed files with 12 additions and 2 deletions

View file

@ -95,6 +95,13 @@ Pianoroll::~Pianoroll ()
delete bindings;
}
bool
Pianoroll::enter (GdkEventCrossing*)
{
switch_editing_context (this);
return false;
}
void
Pianoroll::load_bindings ()
{
@ -291,7 +298,9 @@ Pianoroll::build_upper_toolbar ()
Bindings* pr_bindings = Bindings::get_bindings (X_("Pianoroll"));
_toolbox.set_data (X_("ardour-bindings"), pr_bindings);
_contents.add (_toolbox);
_contents.signal_enter_notify_event().connect (sigc::mem_fun (*this, &Pianoroll::enter), false);
}
void

View file

@ -281,4 +281,5 @@ class Pianoroll : public CueEditor
std::pair<Temporal::timepos_t,Temporal::timepos_t> max_zoom_extent() const;
void point_selection_changed ();
bool enter (GdkEventCrossing*);
};

View file

@ -30,8 +30,8 @@ PianorollWindow::PianorollWindow (std::string const & name, Session& s)
pianoroll->set_session (&s);
pianoroll->viewport().set_size_request (600, 120);
add (pianoroll->toolbox());
pianoroll->toolbox().show ();
add (pianoroll->contents());
pianoroll->contents().show ();
}
PianorollWindow::~PianorollWindow ()