Commit 783b8ed1 authored by Mike Kremer's avatar Mike Kremer
Browse files

Automatically set toggle selection metaphor to be the default one in case none is selected.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11314 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 12a56e64
...@@ -675,9 +675,11 @@ void SelectionBasePlugin::updateActivePrimitiveTypes(bool _checked) { ...@@ -675,9 +675,11 @@ void SelectionBasePlugin::updateActivePrimitiveTypes(bool _checked) {
// If currently selected selection mode is not available // If currently selected selection mode is not available
// for the currently active primitive types, reset selection mode // for the currently active primitive types, reset selection mode
QList<QAction*> sm_actions = selectionModesGroup_->actions(); QList<QAction*> sm_actions = selectionModesGroup_->actions();
bool atLeastOneSelectionMode = false;
for(int i = 0; i < sm_actions.size(); ++i) { for(int i = 0; i < sm_actions.size(); ++i) {
if(sm_actions[i]->isChecked()) { if(sm_actions[i]->isChecked()) {
atLeastOneSelectionMode = true;
HandleAction* ha = 0; HandleAction* ha = 0;
ha = dynamic_cast<HandleAction*>(sm_actions[i]); ha = dynamic_cast<HandleAction*>(sm_actions[i]);
if(ha) { if(ha) {
...@@ -690,6 +692,10 @@ void SelectionBasePlugin::updateActivePrimitiveTypes(bool _checked) { ...@@ -690,6 +692,10 @@ void SelectionBasePlugin::updateActivePrimitiveTypes(bool _checked) {
} }
} }
} }
// If no selection mode is active, automatically go into toggle mode
if(!atLeastOneSelectionMode) {
toggleSelectionAction_->trigger();
}
// Automatically show tab widget associated to this primitive type // Automatically show tab widget associated to this primitive type
std::map<QString,SelectionEnvironment>::iterator sit = selectionEnvironments_.find(clickedAction->selectionEnvironmentHandle()); std::map<QString,SelectionEnvironment>::iterator sit = selectionEnvironments_.find(clickedAction->selectionEnvironmentHandle());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment