mirror of https://github.com/KLayout/klayout.git
Fixed a refactoring damage: the application mode indicator did not follow programmatic changes.
This commit is contained in:
parent
4cdb76a33e
commit
d1f1cf3031
|
|
@ -1850,7 +1850,7 @@ MainWindow::select_mode (int m)
|
|||
std::vector<std::string> items = menu ()->items ("@toolbar");
|
||||
for (std::vector<std::string>::const_iterator i = items.begin (); i != items.end (); ++i) {
|
||||
Action *a = menu ()->action (*i);
|
||||
if (a->qaction ()->isCheckable() && a->qaction ()->data ().toInt () == m_mode) {
|
||||
if (a->is_checkable() && a->is_for_mode (m_mode)) {
|
||||
a->set_checked (true);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,6 +301,14 @@ public:
|
|||
*/
|
||||
virtual void triggered ();
|
||||
|
||||
/**
|
||||
* @brief Returns true, if the action is associated with a specific mode ID
|
||||
*/
|
||||
virtual bool is_for_mode (int /*mode_id*/) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the underlying QAction object
|
||||
*
|
||||
|
|
|
|||
|
|
@ -131,6 +131,11 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool is_for_mode (int mode_id) const
|
||||
{
|
||||
return mode_id == m_mode;
|
||||
}
|
||||
|
||||
private:
|
||||
Dispatcher *mp_dispatcher;
|
||||
int m_mode;
|
||||
|
|
|
|||
Loading…
Reference in New Issue