MenuField: enable/disable the menu field when...
the child menu bar or the child menu bar's menu is enabled/disabled. This means that there is just one status we have to check, the menu fields, and the child menus agree. This change takes practical form in the Backgrounds preflet which disables the placement menu when the image is set to "None", but, only the menu got disabled and not the parent menu field so the label was erroneously still drawn as enabled.
This commit is contained in:
@@ -52,6 +52,7 @@ public:
|
||||
virtual void MessageReceived(BMessage* msg);
|
||||
virtual void MakeFocus(bool focused = true);
|
||||
virtual void SetMaxContentWidth(float width);
|
||||
virtual void SetEnabled(bool enabled);
|
||||
|
||||
void TogglePopUpMarker(bool show)
|
||||
{ fShowPopUpMarker = show; }
|
||||
|
||||
@@ -276,6 +276,15 @@ _BMCMenuBar_::SetMaxContentWidth(float width)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_BMCMenuBar_::SetEnabled(bool enabled)
|
||||
{
|
||||
fMenuField->SetEnabled(enabled);
|
||||
|
||||
BMenuBar::SetEnabled(enabled);
|
||||
}
|
||||
|
||||
|
||||
BSize
|
||||
_BMCMenuBar_::MinSize()
|
||||
{
|
||||
|
||||
@@ -1021,6 +1021,9 @@ BMenu::SetEnabled(bool enabled)
|
||||
|
||||
fEnabled = enabled;
|
||||
|
||||
if (dynamic_cast<_BMCMenuBar_*>(Supermenu()) != NULL)
|
||||
Supermenu()->SetEnabled(enabled);
|
||||
|
||||
if (fSuperitem)
|
||||
fSuperitem->SetEnabled(enabled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user