diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index c334f1a1d6..53658666f1 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -1004,7 +1004,7 @@ BMenu::_show(bool selectFirstItem) fCachedMenuWindow = new BMenuWindow(Name()); fCachedMenuWindow->ChildAt(0)->AddChild(this); - fCachedMenuWindow->ResizeTo(Bounds().Width() + 3, Bounds().Height() + 3); + fCachedMenuWindow->ResizeTo(Bounds().Width() + 4, Bounds().Height() + 4); fCachedMenuWindow->MoveTo(ScreenLocation()); fCachedMenuWindow->Show(); @@ -1181,11 +1181,11 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems, if (item->fModifiers && item->fShortcutChar) iWidth += 25.0f; - item->fBounds.left = 2.0f; + item->fBounds.left = 0.0f; item->fBounds.top = frame.bottom; item->fBounds.bottom = item->fBounds.top + iHeight + fPad.top + fPad.bottom; - frame.right = max_c(frame.right, iWidth + fPad.left + fPad.right); + frame.right = max_c(frame.right, iWidth + fPad.left + fPad.right) + 20; frame.bottom = item->fBounds.bottom + 1.0f; } } @@ -1193,8 +1193,8 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems, for (int32 i = 0; i < fItems.CountItems(); i++) ItemAt(i)->fBounds.right = frame.right; - frame.right = (float)ceil(frame.right) + 2.0f; - frame.bottom += 1.0f; + frame.right = (float)ceil(frame.right); + frame.bottom--; break; } @@ -1244,11 +1244,12 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems, break; } + // This is for BMenuBar. if ((ResizingMode() & B_FOLLOW_LEFT_RIGHT) == B_FOLLOW_LEFT_RIGHT) { if (Parent()) - *width = Parent()->Frame().Width(); + *width = Parent()->Frame().Width() + 1; else - *width = Window()->Frame().Width(); + *width = Window()->Frame().Width() + 1; *height = frame.Height(); } else { diff --git a/src/kits/interface/MenuWindow.cpp b/src/kits/interface/MenuWindow.cpp index 1408eed190..288f91be69 100644 --- a/src/kits/interface/MenuWindow.cpp +++ b/src/kits/interface/MenuWindow.cpp @@ -26,8 +26,6 @@ //------------------------------------------------------------------------------ // TODO: Add scrollers -#include - #include #include @@ -35,10 +33,11 @@ // this should go to some private header. const window_feel kMenuWindowFeel = (window_feel)1025; +// This draws the frame around the BMenu class BMenuFrame : public BView { public: BMenuFrame() : - BView(BRect(0, 0, 0, 0), "menu frame", B_FOLLOW_ALL_SIDES, B_WILL_DRAW) + BView(BRect(0, 0, 1, 1), "menu frame", B_FOLLOW_ALL_SIDES, B_WILL_DRAW) { }; @@ -57,9 +56,12 @@ public: SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_2_TINT)); StrokeLine(BPoint(bounds.left + 2, bounds.bottom - 1), BPoint(bounds.right - 1, bounds.bottom - 1)); + StrokeLine(BPoint(bounds.right - 1, bounds.top + 1), + BPoint(bounds.right - 1, bounds.bottom - 1)); SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_LIGHTEN_2_TINT)); StrokeLine(BPoint(bounds.left + 1, bounds.top + 1), - BPoint(bounds.right - 2, bounds.top + 1)); + BPoint(bounds.right - 2, bounds.top + 1)); + }; }; diff --git a/src/kits/interface/SeparatorItem.cpp b/src/kits/interface/SeparatorItem.cpp index 18cd5219e9..87d5b3922d 100644 --- a/src/kits/interface/SeparatorItem.cpp +++ b/src/kits/interface/SeparatorItem.cpp @@ -95,7 +95,7 @@ BSeparatorItem::Draw() case 0: // TODO: Check if drawing is pixel perfect menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_DARKEN_2_TINT)); + B_DARKEN_1_TINT)); menu->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 4.0f), BPoint(bounds.right - 1.0f, bounds.top + 4.0f)); menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), @@ -108,7 +108,7 @@ BSeparatorItem::Draw() case 1: // TODO: Check if drawing is pixel perfect menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_DARKEN_2_TINT)); + B_DARKEN_1_TINT)); menu->StrokeLine(BPoint(bounds.left + 9.0f, bounds.top + 4.0f), BPoint(bounds.right - 9.0f, bounds.top + 4.0f)); menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), @@ -120,7 +120,7 @@ BSeparatorItem::Draw() case 2: menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_DARKEN_2_TINT)); + B_DARKEN_1_TINT)); menu->StrokeLine(BPoint(bounds.left + 9.0f, bounds.top + 4.0f), BPoint(bounds.right - 9.0f, bounds.top + 4.0f)); menu->StrokeLine(BPoint(bounds.left + 10.0f, bounds.top + 5.0f),