diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index 491f0ce33e..e6b91d0095 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -228,31 +228,28 @@ _BMCMenuBar_::FrameResized(float width, float height) { // we need to take care of resizing and cleaning up // the parent menu field - BMenuField* menuField = dynamic_cast(Parent()); - if (menuField) { - float diff = Frame().right - menuField->Bounds().right; - if (Window()) { - if (diff > 0) { - // clean up the dirty right top corner of - // the menu field when enlarging - BRect dirty(menuField->Bounds()); - dirty.left = dirty.right - 2; - dirty.bottom = Frame().top - 1; - menuField->Invalidate(dirty); - } else if (diff < 0) { - // clean up the dirty right line of - // the menu field when shrinking - BRect dirty(menuField->Bounds()); - dirty.left = dirty.right + diff + 1; - dirty.right = dirty.left + 1; - menuField->Invalidate(dirty); - } + float diff = Frame().right - fMenuField->Bounds().right; + if (Window()) { + if (diff > 0) { + // clean up the dirty right top corner of + // the menu field when enlarging + BRect dirty(fMenuField->Bounds()); + dirty.left = dirty.right - 2; + dirty.bottom = Frame().top - 1; + fMenuField->Invalidate(dirty); + } else if (diff < 0) { + // clean up the dirty right line of + // the menu field when shrinking + BRect dirty(fMenuField->Bounds()); + dirty.left = dirty.right + diff + 1; + dirty.right = dirty.left + 1; + fMenuField->Invalidate(dirty); } - // we have been shrinked or enlarged and need to take - // of the size of the parent menu field as well - // NOTE: no worries about follow mode, we follow left and top - menuField->ResizeBy(diff + 2, 0.0); } + // we have been shrinked or enlarged and need to take + // of the size of the parent menu field as well + // NOTE: no worries about follow mode, we follow left and top + fMenuField->ResizeBy(diff + 2, 0.0); BMenuBar::FrameResized(width, height); } diff --git a/src/kits/interface/MenuItem.cpp b/src/kits/interface/MenuItem.cpp index 617615f049..f59003fe77 100644 --- a/src/kits/interface/MenuItem.cpp +++ b/src/kits/interface/MenuItem.cpp @@ -625,6 +625,7 @@ BMenuItem::DrawMarkSymbol() fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_4_TINT)); + fSuper->BeginLineArray(4); fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 4.0f), BPoint(fBounds.left + 10.0f, fBounds.bottom - 13.0f)); fSuper->StrokeLine(BPoint(fBounds.left + 5.0f, fBounds.bottom - 4.0f), @@ -633,6 +634,7 @@ BMenuItem::DrawMarkSymbol() BPoint(fBounds.left + 3.0f, fBounds.bottom - 9.0f)); fSuper->StrokeLine(BPoint(fBounds.left + 4.0f, fBounds.bottom - 4.0f), BPoint(fBounds.left + 2.0f, fBounds.bottom - 9.0f)); + fSuper->EndLineArray(); fSuper->SetDrawingMode(B_OP_COPY); } diff --git a/src/kits/interface/OptionPopUp.cpp b/src/kits/interface/OptionPopUp.cpp index 0f2adb0c9d..a1f95d1de9 100644 --- a/src/kits/interface/OptionPopUp.cpp +++ b/src/kits/interface/OptionPopUp.cpp @@ -157,12 +157,12 @@ BOptionPopUp::AddOptionAt(const char *name, int32 value, int32 index) BMessage *message = MakeValueMessage(value); if (message == NULL) - return B_ERROR; // TODO: Should return B_NO_MEMORY instead ? + return B_NO_MEMORY; BMenuItem *newItem = new BMenuItem(name, message); if (newItem == NULL) { delete message; - return B_ERROR; // TODO: same as above + return B_NO_MEMORY; } menu->AddItem(newItem, index); @@ -355,7 +355,7 @@ BOptionPopUp::BOptionPopUp(const BOptionPopUp &clone) BOptionPopUp & BOptionPopUp::operator=(const BOptionPopUp & clone) { - return *this; + return *this; }