MenuItem::isEnabled() is sufficient to decide Menu::isItemSelectable()
MenuSeparator is never enabled since it returns always 'false' in its implementation of isEnabled(). no need to use RTTI imho.
This commit is contained in:
parent
bb480030f5
commit
05a52116df
1 changed files with 1 additions and 3 deletions
|
@ -842,9 +842,7 @@ bool Menu::isItemSelectable(unsigned int index) const {
|
||||||
if (index >= menuitems.size()) return false;
|
if (index >= menuitems.size()) return false;
|
||||||
|
|
||||||
const MenuItem *item = find(index);
|
const MenuItem *item = find(index);
|
||||||
return (!item ||
|
return (!item || !item->isEnabled()) ? false : true;
|
||||||
(typeid(*item) == typeid(FbTk::MenuSeparator)) ||
|
|
||||||
!item->isEnabled()) ? false : true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue