From 5aa032f1e8b7ccb4c5659a89d6517460ab2a501c Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 20 Dec 2005 16:28:52 +0000 Subject: [PATCH] cleanup git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15617 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/MenuWindow.cpp | 53 +++++++++++++++++++------------ 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/src/kits/interface/MenuWindow.cpp b/src/kits/interface/MenuWindow.cpp index 0e3d6a4688..dcb9aabc3d 100644 --- a/src/kits/interface/MenuWindow.cpp +++ b/src/kits/interface/MenuWindow.cpp @@ -36,28 +36,10 @@ const window_feel kMenuWindowFeel = (window_feel)1025; // This draws the frame around the BMenu class BMenuFrame : public BView { public: - BMenuFrame() : - BView(BRect(0, 0, 1, 1), "menu frame", B_FOLLOW_ALL_SIDES, B_WILL_DRAW) - { - }; - - virtual void AttachedToWindow() - { - BView::AttachedToWindow(); - ResizeTo(Window()->Bounds().Width(), Window()->Bounds().Height()); - }; - - virtual void Draw(BRect updateRect) - { - BRect bounds(Bounds()); - - SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_2_TINT)); - StrokeLine(BPoint(bounds.right, bounds.top), - BPoint(bounds.right, bounds.bottom - 1)); - StrokeLine(BPoint(bounds.left + 1, bounds.bottom), - BPoint(bounds.right, bounds.bottom)); - }; + BMenuFrame() ; + virtual void AttachedToWindow(); + virtual void Draw(BRect updateRect); }; @@ -79,3 +61,32 @@ BMenuWindow::BMenuWindow(const char *name) BMenuWindow::~BMenuWindow() { } + + +// BMenuFrame +BMenuFrame::BMenuFrame() + : + BView(BRect(0, 0, 1, 1), "menu frame", B_FOLLOW_ALL_SIDES, B_WILL_DRAW) +{ +} + + +void +BMenuFrame::AttachedToWindow() +{ + BView::AttachedToWindow(); + ResizeTo(Window()->Bounds().Width(), Window()->Bounds().Height()); +} + + +void +BMenuFrame::Draw(BRect updateRect) +{ + BRect bounds(Bounds()); + + SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_2_TINT)); + StrokeLine(BPoint(bounds.right, bounds.top), + BPoint(bounds.right, bounds.bottom - 1)); + StrokeLine(BPoint(bounds.left + 1, bounds.bottom), + BPoint(bounds.right, bounds.bottom)); +}