Lock behavior change: do not show lock icon on unlocked inactive sources

Show unlocked icon only when active, show locked icon always
This commit is contained in:
Bruno Herbelin
2022-04-09 19:29:37 +02:00
parent 3e41655902
commit 220df8918c
4 changed files with 7 additions and 5 deletions

View File

@@ -449,7 +449,8 @@ std::pair<Node *, glm::vec2> GeometryView::pick(glm::vec2 P)
// pick on the lock icon; unlock source // pick on the lock icon; unlock source
else if ( UserInterface::manager().ctrlModifier() && pick.first == current->lock_ ) { else if ( UserInterface::manager().ctrlModifier() && pick.first == current->lock_ ) {
lock(current, false); lock(current, false);
pick = { nullptr, glm::vec2(0.f) }; pick = { current->locker_, pick.second };
// pick = { nullptr, glm::vec2(0.f) };
} }
// pick on the open lock icon; lock source and cancel pick // pick on the open lock icon; lock source and cancel pick
else if ( UserInterface::manager().ctrlModifier() && pick.first == current->unlock_ ) { else if ( UserInterface::manager().ctrlModifier() && pick.first == current->unlock_ ) {

View File

@@ -241,8 +241,8 @@ std::pair<Node *, glm::vec2> LayerView::pick(glm::vec2 P)
// pick on the lock icon; unlock source // pick on the lock icon; unlock source
if ( UserInterface::manager().ctrlModifier() && pick.first == s->lock_) { if ( UserInterface::manager().ctrlModifier() && pick.first == s->lock_) {
lock(s, false); lock(s, false);
// pick = { s->locker_, pick.second }; pick = { s->locker_, pick.second };
pick = { nullptr, glm::vec2(0.f) }; // pick = { nullptr, glm::vec2(0.f) };
} }
// pick on the open lock icon; lock source and cancel pick // pick on the open lock icon; lock source and cancel pick
else if ( UserInterface::manager().ctrlModifier() && pick.first == s->unlock_ ) { else if ( UserInterface::manager().ctrlModifier() && pick.first == s->unlock_ ) {

View File

@@ -414,8 +414,8 @@ std::pair<Node *, glm::vec2> MixingView::pick(glm::vec2 P)
// pick on the lock icon; unlock source // pick on the lock icon; unlock source
if ( UserInterface::manager().ctrlModifier() && pick.first == s->lock_) { if ( UserInterface::manager().ctrlModifier() && pick.first == s->lock_) {
lock(s, false); lock(s, false);
// pick = { s->locker_, pick.second }; pick = { s->locker_, pick.second };
pick = { nullptr, glm::vec2(0.f) }; // pick = { nullptr, glm::vec2(0.f) };
} }
// pick on the open lock icon; lock source and cancel pick // pick on the open lock icon; lock source and cancel pick
else if ( UserInterface::manager().ctrlModifier() && pick.first == s->unlock_ ) { else if ( UserInterface::manager().ctrlModifier() && pick.first == s->unlock_ ) {

View File

@@ -409,6 +409,7 @@ void Source::setMode(Source::Mode m)
// the lock icon // the lock icon
locker_->setActive( locked_ ? 0 : 1); locker_->setActive( locked_ ? 0 : 1);
locker_->child(1)->visible_ = current;
// the mixing group overlay // the mixing group overlay
overlay_mixinggroup_->visible_ = mixinggroup_!= nullptr && !locked_; overlay_mixinggroup_->visible_ = mixinggroup_!= nullptr && !locked_;