mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Use the same criteron to sensitize the choose-top-region menu item as to decide whether to open it or not, to prevent a sensitive menu item that does nothing.
git-svn-id: svn://localhost/ardour2/branches/3.0@11322 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
5248d79fa4
commit
6918bba170
1 changed files with 2 additions and 9 deletions
|
|
@ -1807,17 +1807,10 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items, boost::sha
|
||||||
_popup_region_menu_item->set_label (menu_item_name);
|
_popup_region_menu_item->set_label (menu_item_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use the mouse position rather than the edit point to decide whether to show the `choose top region'
|
const framepos_t position = get_preferred_edit_position (false, true);
|
||||||
dialogue. If we use the edit point it gets a bit messy because the user still has to click over
|
|
||||||
*some* region in order to get the region context menu stuff to be displayed at all.
|
|
||||||
*/
|
|
||||||
|
|
||||||
framepos_t mouse;
|
|
||||||
bool ignored;
|
|
||||||
mouse_frame (mouse, ignored);
|
|
||||||
|
|
||||||
edit_items.push_back (*_popup_region_menu_item);
|
edit_items.push_back (*_popup_region_menu_item);
|
||||||
if (track->playlist()->count_regions_at (mouse) > 1 && (layering_order_editor == 0 || !layering_order_editor->is_visible ())) {
|
if (track->playlist()->count_regions_at (position) > 1 && (layering_order_editor == 0 || !layering_order_editor->is_visible ())) {
|
||||||
edit_items.push_back (*manage (_region_actions->get_action ("choose-top-region-context-menu")->create_menu_item ()));
|
edit_items.push_back (*manage (_region_actions->get_action ("choose-top-region-context-menu")->create_menu_item ()));
|
||||||
}
|
}
|
||||||
edit_items.push_back (SeparatorElem());
|
edit_items.push_back (SeparatorElem());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue