Merge branch 'chaot4-fix_scrolling_midi_region_head'

This commit is contained in:
Paul Davis 2015-12-02 15:02:56 -05:00
commit fe4cc2e0a0
3 changed files with 16 additions and 1 deletions

View File

@ -49,6 +49,7 @@ using namespace std;
ArdourDropdown::ArdourDropdown (Element e)
: _scrolling_disabled(false)
{
// signal_button_press_event().connect (sigc::mem_fun(*this, &ArdourDropdown::on_mouse_pressed));
@ -74,6 +75,10 @@ ArdourDropdown::on_scroll_event (GdkEventScroll* ev)
{
using namespace Menu_Helpers;
if (_scrolling_disabled) {
return false;
}
const MenuItem * current_active = _menu.get_active();
const MenuList& items = _menu.items ();
int c = 0;
@ -142,4 +147,8 @@ ArdourDropdown::AddMenuElem (Menu_Helpers::Element e)
items.push_back (e);
}
void
ArdourDropdown::disable_scrolling()
{
_scrolling_disabled = true;
}

View File

@ -42,8 +42,12 @@ class ArdourDropdown : public ArdourButton
void clear_items ();
void AddMenuElem (Gtk::Menu_Helpers::Element e);
void disable_scrolling();
private:
Gtk::Menu _menu;
bool _scrolling_disabled;
};
#endif /* __gtk2_ardour_ardour_dropdown_h__ */

View File

@ -121,6 +121,8 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session* sess, ArdourCanva
, controller_menu (0)
, _step_editor (0)
{
_midnam_model_selector.disable_scrolling();
_midnam_custom_device_mode_selector.disable_scrolling();
}
void