diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index 9fea44fa97..a8fa8503c3 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -227,7 +227,7 @@ void Action::setMenuRole(QAction::MenuRole menuRole) * to the command object. */ ActionGroup::ActionGroup ( Command* pcCmd,QObject * parent) - : Action(pcCmd, parent), _group(0), _dropDown(false),_external(false),_toggle(false) + : Action(pcCmd, parent), _group(0), _dropDown(false),_external(false),_toggle(false),_isMode(false) { _group = new QActionGroup(this); connect(_group, SIGNAL(triggered(QAction*)), this, SLOT(onActivated (QAction*))); @@ -336,7 +336,7 @@ void ActionGroup::setCheckedAction(int i) QAction* a = _group->actions()[i]; a->setChecked(true); this->setIcon(a->icon()); - this->setToolTip(a->toolTip()); + if (!this->_isMode) this->setToolTip(a->toolTip()); this->setProperty("defaultAction", QVariant(i)); } @@ -378,7 +378,7 @@ void ActionGroup::onActivated (QAction* a) } #endif this->setIcon(a->icon()); - this->setToolTip(a->toolTip()); + if (!this->_isMode) this->setToolTip(a->toolTip()); this->setProperty("defaultAction", QVariant(index)); _pcCmd->invoke(index, Command::TriggerChildAction); } diff --git a/src/Gui/Action.h b/src/Gui/Action.h index 5aa6f2c313..d50deb8cb0 100644 --- a/src/Gui/Action.h +++ b/src/Gui/Action.h @@ -107,6 +107,7 @@ public: void setExclusive (bool); bool isExclusive() const; void setVisible (bool); + void setIsMode(bool b) { _isMode = b; } void setDropDownMenu(bool b) { _dropDown = b; } QAction* addAction(QAction*); @@ -126,6 +127,7 @@ protected: bool _dropDown; bool _external; bool _toggle; + bool _isMode; }; // -------------------------------------------------------------------- diff --git a/src/Gui/CommandStd.cpp b/src/Gui/CommandStd.cpp index 2ee06da8cb..a0ae9fdea4 100644 --- a/src/Gui/CommandStd.cpp +++ b/src/Gui/CommandStd.cpp @@ -850,6 +850,7 @@ Gui::Action * StdCmdUserEditMode::createAction(void) { Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow()); pcAction->setDropDownMenu(true); + pcAction->setIsMode(true); applyCommandData(this->className(), pcAction); for (auto const &uem : Gui::Application::Instance->listUserEditModes()) {