handle Escape signal in all EditingContexts (including MidiCueEditor)
This commit is contained in:
parent
f2e1697058
commit
dc44d10b48
@ -38,6 +38,7 @@
|
||||
#include "editing_context.h"
|
||||
#include "editing_convert.h"
|
||||
#include "editor_drag.h"
|
||||
#include "gui_thread.h"
|
||||
#include "keyboard.h"
|
||||
#include "midi_region_view.h"
|
||||
#include "note_base.h"
|
||||
@ -154,6 +155,10 @@ EditingContext::EditingContext (std::string const & name)
|
||||
_cursors->set_cursor_set (UIConfiguration::instance().get_icon_set());
|
||||
std::cerr << "Set cursor set to " << UIConfiguration::instance().get_icon_set() << std::endl;
|
||||
}
|
||||
|
||||
/* handle escape */
|
||||
|
||||
ARDOUR_UI::instance()->Escape.connect (escape_connection, MISSING_INVALIDATOR, boost::bind (&EditingContext::escape, this), gui_context());
|
||||
}
|
||||
|
||||
EditingContext::~EditingContext()
|
||||
|
@ -624,6 +624,9 @@ public:
|
||||
uint32_t autoscroll_cnt;
|
||||
ArdourCanvas::Rect autoscroll_boundary;
|
||||
|
||||
PBD::ScopedConnection escape_connection;
|
||||
virtual void escape () {}
|
||||
|
||||
private:
|
||||
static std::stack<EditingContext*> ec_stack;
|
||||
|
||||
|
@ -1418,3 +1418,13 @@ MidiCueEditor::midi_action (void (MidiView::*method)())
|
||||
|
||||
(view->*method) ();
|
||||
}
|
||||
|
||||
void
|
||||
MidiCueEditor::escape ()
|
||||
{
|
||||
if (!view) {
|
||||
return;
|
||||
}
|
||||
|
||||
view->clear_note_selection ();
|
||||
}
|
||||
|
@ -122,6 +122,8 @@ class MidiCueEditor : public CueEditor
|
||||
|
||||
void mouse_mode_toggled (Editing::MouseMode);
|
||||
|
||||
void escape ();
|
||||
|
||||
private:
|
||||
ArdourCanvas::GtkCanvasViewport* _canvas_viewport;
|
||||
ArdourCanvas::GtkCanvas* _canvas;
|
||||
|
Loading…
Reference in New Issue
Block a user