diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 8bd7c5b2c9..28144eb2cc 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -530,6 +530,14 @@ BMenu::SetEnabled(bool enabled) { fEnabled = enabled; + + if (fSuper) { + // Can't use fSuper->SetEnabled() here, as + // it would call SetEnabled() on us again, thus + // entering an infinite loop + fSuper->fEnabled = enabled; + } + for (int32 i = 0; i < CountItems(); i++) ItemAt(i)->SetEnabled(enabled); } @@ -539,6 +547,8 @@ void BMenu::SetRadioMode(bool flag) { fRadioMode = flag; + if (!flag) + SetLabelFromMarked(false); } @@ -560,6 +570,8 @@ void BMenu::SetLabelFromMarked(bool flag) { fDynamicName = flag; + if (flag) + SetRadioMode(true); } @@ -935,7 +947,7 @@ BMenu::Hide() BMenuItem * BMenu::Track(bool openAnyway, BRect *clickToOpenRect) { - if (IsStickyPrefOn()) + if (!IsStickyPrefOn()) openAnyway = false; SetStickyMode(openAnyway); diff --git a/src/kits/interface/MenuBar.cpp b/src/kits/interface/MenuBar.cpp index fd2798eb70..ac6e724b11 100644 --- a/src/kits/interface/MenuBar.cpp +++ b/src/kits/interface/MenuBar.cpp @@ -136,34 +136,28 @@ void BMenuBar::Draw(BRect updateRect) { // TODO: implement additional border styles - if (IsEnabled()) { - rgb_color color = HighColor(); + rgb_color color = HighColor(); + + BRect bounds(Bounds()); + // Restore the background of the previously selected menuitem + DrawBackground(bounds & updateRect); - BRect bounds(Bounds()); - // Restore the background of the previously selected menuitem - DrawBackground(bounds & updateRect); + SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_LIGHTEN_2_TINT)); + StrokeLine(BPoint(0.0f, bounds.bottom - 2.0f), BPoint(0.0f, 0.0f)); + StrokeLine(BPoint(bounds.right, 0.0f)); - SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_LIGHTEN_2_TINT)); - StrokeLine(BPoint(0.0f, bounds.bottom - 2.0f), BPoint(0.0f, 0.0f)); - StrokeLine(BPoint(bounds.right, 0.0f)); + SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_1_TINT)); + StrokeLine(BPoint(1.0f, bounds.bottom - 1.0f), + BPoint(bounds.right, bounds.bottom - 1.0f)); - SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_1_TINT)); - StrokeLine(BPoint(1.0f, bounds.bottom - 1.0f), - BPoint(bounds.right, bounds.bottom - 1.0f)); + SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_2_TINT)); + StrokeLine(BPoint(0.0f, bounds.bottom), BPoint(bounds.right, bounds.bottom)); + StrokeLine(BPoint(bounds.right, 0.0f), BPoint(bounds.right, bounds.bottom)); - SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_2_TINT)); - StrokeLine(BPoint(0.0f, bounds.bottom), BPoint(bounds.right, bounds.bottom)); - StrokeLine(BPoint(bounds.right, 0.0f), BPoint(bounds.right, bounds.bottom)); + SetHighColor(color); + // revert to previous used color (cheap PushState()/PopState()) - SetHighColor(color); - // revert to previous used color (cheap PushState()/PopState()) - - DrawItems(updateRect); - } else { - LayoutItems(0); - Sync(); - Invalidate(); - } + DrawItems(updateRect); }