fix region action sensitivity issues.

Desensitize all region actions initially, and toggle that state
appropriately when region selection changes
This commit is contained in:
Paul Davis 2016-07-08 08:43:52 -04:00
parent 295a7dfcf3
commit da0bd3d8a5
2 changed files with 11 additions and 8 deletions

View File

@ -2049,6 +2049,6 @@ Editor::register_region_actions ()
reg_sens (_region_actions, "choose-top-region", _("Choose Top..."), sigc::bind (sigc::mem_fun (*this, &Editor::change_region_layering_order), false));
reg_sens (_region_actions, "choose-top-region-context-menu", _("Choose Top..."), sigc::bind (sigc::mem_fun (*this, &Editor::change_region_layering_order), true));
_all_region_actions_sensitized = true;
/* desensitize them all by default. region selection will change this */
sensitize_all_region_actions (false);
}

View File

@ -1088,7 +1088,6 @@ Editor::sensitize_all_region_actions (bool s)
void
Editor::sensitize_the_right_region_actions ()
{
RegionSelection rs = get_regions_from_selection_and_entered ();
sensitize_all_region_actions (!rs.empty ());
@ -1373,11 +1372,15 @@ Editor::region_selection_changed ()
_regions->block_change_connection (false);
editor_regions_selection_changed_connection.block(false);
if (!_all_region_actions_sensitized) {
/* This selection change might have changed what region actions
are allowed, so sensitize them all in case a key is pressed.
*/
sensitize_all_region_actions (true);
if (selection->regions.empty()) {
sensitize_all_region_actions (false);
} else {
if (!_all_region_actions_sensitized) {
/* This selection change might have changed what region actions
are allowed, so sensitize them all in case a key is pressed.
*/
sensitize_all_region_actions (true);
}
}
if (_session && !_session->transport_rolling() && !selection->regions.empty()) {